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 18:16:07 +0100 |
commit | 90674eaa88a3b2f52d8ac1b835c3505b25ff3f00 (patch) | |
tree | 43ee93845a728c250d224eacaabf8ff596f8da21 | |
parent | db93ece847ecae62a67dd3899f41f9625d05f011 (diff) | |
download | perl-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.c | 2 |
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); } |