Marcus Meissner : shell32: Avoid memory leaking buf (Coverity).
Module: wine Branch: master Commit: 9eb7378765109b880d7643bc964b0e38222f6524 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9eb7378765109b880d7643bc96... Author: Marcus Meissner <marcus(a)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;
participants (1)
-
Alexandre Julliard