diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-05-13 12:53:10 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-05-14 21:11:51 +0100 |
commit | 2358a1918b2f128e65221e2955c29a14b073e17d (patch) | |
tree | 58f0370aabb82e9a13c078367a6eac2e2a6b0421 | |
parent | c73fd03d775cbef1645428cd9dbc2b0a3448c298 (diff) | |
download | perl-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.c | 2 |
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); } |