Marcus Meissner : shell32: Avoid memory leaking buf (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Oct 15 14:29:05 CDT 2012


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sat Oct 13 17:19:40 2012 +0200

shell32: Avoid memory leaking buf (Coverity).

---

 dlls/shell32/shlexec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 5799ab0..1c6fa29 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1724,8 +1724,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
 
         size = MAX_PATH;
         buf = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
-        if (FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0)))
+        if (!buf || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0))) {
+            HeapFree(GetProcessHeap(), 0, buf);
             return SE_ERR_OOM;
+        }
 
         HeapFree(GetProcessHeap(), 0, wszApplicationName);
         dwApplicationNameLen = lstrlenW(buf) + 1;




More information about the wine-cvs mailing list