shell32: Avoid memory leaking buf (Coverity).

This commit is contained in:
Marcus Meissner 2012-10-13 17:19:40 +02:00 committed by Alexandre Julliard
parent c9bd05d89e
commit 9eb7378765
1 changed files with 3 additions and 1 deletions

View File

@ -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;