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 21:11:51 +0100
commit2358a1918b2f128e65221e2955c29a14b073e17d (patch)
tree58f0370aabb82e9a13c078367a6eac2e2a6b0421
parentc73fd03d775cbef1645428cd9dbc2b0a3448c298 (diff)
downloadperl-2358a1918b2f128e65221e2955c29a14b073e17d.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. (cherry picked from commit 90674eaa88a3b2f52d8ac1b835c3505b25ff3f00)
-rw-r--r--win32/win32.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index bda5356861..081aa0ba9d 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1774,6 +1774,8 @@ win32_getenvironmentstrings(void)
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, lpWStr, wenvstrings_len, lpStr,
aenvstrings_len, NULL, NULL);
+ FreeEnvironmentStrings(lpWStr);
+
return(lpStr);
}