Skip to content

Commit 90674ea

Browse files
committed
[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.
1 parent db93ece commit 90674ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

win32/win32.c

+2
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,8 @@ win32_getenvironmentstrings(void)
17701770
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, lpWStr, wenvstrings_len, lpStr,
17711771
aenvstrings_len, NULL, NULL);
17721772

1773+
FreeEnvironmentStrings(lpWStr);
1774+
17731775
return(lpStr);
17741776
}
17751777

0 commit comments

Comments
 (0)