userenv/tests: Fix a memory leak (valgrind)

Bruno Jesus 00cpxxx at gmail.com
Thu May 29 21:16:09 CDT 2014


For bug https://bugs.winehq.org/show_bug.cgi?id=36588
-------------- next part --------------
diff --git a/dlls/userenv/tests/userenv.c b/dlls/userenv/tests/userenv.c
index b085d17..9e4179f 100644
--- a/dlls/userenv/tests/userenv.c
+++ b/dlls/userenv/tests/userenv.c
@@ -154,6 +154,7 @@ static void test_create_env(void)
         r = get_env(env[i], "SystemRoot", &st);
         ok(!strcmp(st, "SystemRoot=overwrite"), "%s\n", st);
         expect(TRUE, r);
+        if (r) HeapFree(GetProcessHeap(), 0, st);
     }
 
     /* Test for common environment variables (NT4 and higher) */


More information about the wine-patches mailing list