Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git] / mono / utils / mono-hwcap.c
index 00fad690193a5f8415f4afc317b1c28afa97fd99..c0e68ee034fffc8368b0ce06660a2f9ae4eadcd6 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * mono-hwcap.c: Hardware feature detection
+/**
+ * \file
+ * Hardware feature detection
  *
  * Authors:
  *    Alex Rønne Petersen (alexrp@xamarin.com)
@@ -33,8 +34,8 @@ static gboolean hwcap_inited = FALSE;
 void
 mono_hwcap_init (void)
 {
-       const char *verbose = g_getenv ("MONO_VERBOSE_HWCAP");
-       const char *conservative = g_getenv ("MONO_CONSERVATIVE_HWCAP");
+       char *verbose = g_getenv ("MONO_VERBOSE_HWCAP");
+       char *conservative = g_getenv ("MONO_CONSERVATIVE_HWCAP");
 
        if (hwcap_inited)
                return;
@@ -44,6 +45,9 @@ mono_hwcap_init (void)
 
        if (verbose && !strncmp (verbose, "1", 1))
                mono_hwcap_print ();
+
+       g_free (verbose);
+       g_free (conservative);
 }
 
 void