summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-05-13 12:53:10 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2014-05-14 18:16:07 +0100
commit90674eaa88a3b2f52d8ac1b835c3505b25ff3f00 (patch)
tree43ee93845a728c250d224eacaabf8ff596f8da21
parentdb93ece847ecae62a67dd3899f41f9625d05f011 (diff)
downloadperl-90674eaa88a3b2f52d8ac1b835c3505b25ff3f00.tar.gz
[perl #121676] Fix memory leak in backticks and system
Introduced by perl #113536. It doesn't actually leak on Windows XP due to differences in the implementation of GetEnvironmentStringsW() compared to later OSes, but the missing FreeEnvironmentStrings() was technically wrong anyway, and does now bite. Thanks for Daniel Dragan for finding this.
-rw-r--r--win32/win32.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index bff5b886ac..41d10dd841 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1770,6 +1770,8 @@ win32_getenvironmentstrings(void)
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, lpWStr, wenvstrings_len, lpStr,
aenvstrings_len, NULL, NULL);
+ FreeEnvironmentStrings(lpWStr);
+
return(lpStr);
}