[runtime] Switch getenv to use heap memory
[mono.git] / mono / mini / llvm-jit.cpp
index 868097e617085fc86c9dfb0007a9666922bce742..e10f65766c97c3db26ecd53d7415bbc893ff44c2 100644 (file)
@@ -530,7 +530,11 @@ static void
 force_pass_linking (void)
 {
        // Make sure the rest is linked in, but never executed
-       if (g_getenv ("FOO") != (char*)-1)
+       char *foo = g_getenv ("FOO");
+       gboolean ret = (foo != (char*)-1);
+       g_free (foo);
+
+       if (ret) 
                return;
 
        // This is a subset of the passes in LinkAllPasses.h