cmd: Fix some leaks (coverity)
Frédéric Delanoy
frederic.delanoy at gmail.com
Wed Oct 31 22:10:01 CDT 2012
CIDs 713827 & 731829
---
programs/cmd/builtins.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index b3fd422..72d4f43 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -1403,6 +1403,7 @@ void WCMD_echo (const WCHAR *args)
&& origcommand[0]!=';') {
if (echo_mode) WCMD_output (WCMD_LoadMessage(WCMD_ECHOPROMPT), onW);
else WCMD_output (WCMD_LoadMessage(WCMD_ECHOPROMPT), offW);
+ HeapFree(GetProcessHeap(), 0, trimmed);
return;
}
@@ -2930,7 +2931,7 @@ void WCMD_endlocal (void) {
/* delete the current environment, totally */
env = GetEnvironmentStringsW ();
- old = WCMD_dupenv (GetEnvironmentStringsW ());
+ old = WCMD_dupenv (env);
len = 0;
while (old[len]) {
n = strlenW(&old[len]) + 1;
--
1.8.0
More information about the wine-patches
mailing list