Commit 80b01c8f2639da24c1dc78a635abf12e111cf4d1

Edward Thomson 2014-12-08T16:06:15

win32: remember to free wide env name/value

diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index 9640b92..10f37ad 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -80,7 +80,7 @@ char *cl_getenv(const char *name)
 
 int cl_setenv(const char *name, const char *value)
 {
-	wchar_t *wide_name, *wide_value;
+	wchar_t *wide_name, *wide_value = NULL;
 
 	cl_assert(git__utf8_to_16_alloc(&wide_name, name) >= 0);
 
@@ -95,6 +95,8 @@ int cl_setenv(const char *name, const char *value)
 		SetEnvironmentVariableW(wide_name, NULL);
 	}
 
+	git__free(wide_name);
+	git__free(wide_value);
 	return 0;
 }