shell32: Fix a use after free (Coverity).

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Sven Baars 2019-05-28 23:51:04 +02:00 committed by Alexandre Julliard
parent 097733fe0d
commit e6ce281d30
1 changed files with 3 additions and 1 deletions

View File

@ -1289,9 +1289,11 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent,
if(SUCCEEDED(ret)) if(SUCCEEDED(ret))
{ {
ret = create_shellitemarray(array, cidl, ppsiItemArray); ret = create_shellitemarray(array, cidl, ppsiItemArray);
heap_free(array);
if(SUCCEEDED(ret)) if(SUCCEEDED(ret))
{
heap_free(array);
return ret; return ret;
}
} }
/* Something failed, clean up. */ /* Something failed, clean up. */