Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git] / mono / utils / mono-hwcap.c
index 9d5722e33a1be79c5e67a36369b814bf4ece1811..c0e68ee034fffc8368b0ce06660a2f9ae4eadcd6 100644 (file)
@@ -34,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;
@@ -45,6 +45,9 @@ mono_hwcap_init (void)
 
        if (verbose && !strncmp (verbose, "1", 1))
                mono_hwcap_print ();
+
+       g_free (verbose);
+       g_free (conservative);
 }
 
 void