Andrew Nguyen : msvcrt: Fix a possible memory leak in _wsystem for the NULL command case.

Alexandre Julliard julliard at winehq.org
Mon Jan 17 10:59:48 CST 2011


Module: wine
Branch: master
Commit: b42f162563d0d0e9253f9891ffc04fee9852097c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b42f162563d0d0e9253f9891ffc04fee9852097c

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Sat Jan 15 02:28:13 2011 -0600

msvcrt: Fix a possible memory leak in _wsystem for the NULL command case.

Spotted with Valgrind.

---

 dlls/msvcrt/process.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c
index 349efeb..65518b8 100644
--- a/dlls/msvcrt/process.c
+++ b/dlls/msvcrt/process.c
@@ -1169,6 +1169,7 @@ int CDECL _wsystem(const MSVCRT_wchar_t* cmd)
         *MSVCRT__errno() = MSVCRT_ENOENT;
         return 0;
     }
+    HeapFree(GetProcessHeap(), 0, comspec);
     return 1;
   }
 




More information about the wine-cvs mailing list