shell32: Prevent user after free in error case (Coverity).
Otherwise when hr is not SUCCEEDED we use array and free it again. Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5a231b0bfc
commit
d98646f915
|
@ -1452,15 +1452,15 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl,
|
|||
if(SUCCEEDED(ret))
|
||||
{
|
||||
ret = create_shellitemarray(array, cidl, psia);
|
||||
heap_free(array);
|
||||
if(SUCCEEDED(ret))
|
||||
return ret;
|
||||
}
|
||||
|
||||
for(i = 0; i < cidl; i++)
|
||||
if(array[i]) IShellItem_Release(array[i]);
|
||||
if(FAILED(ret))
|
||||
{
|
||||
for(i = 0; i < cidl; i++)
|
||||
if(array[i]) IShellItem_Release(array[i]);
|
||||
*psia = NULL;
|
||||
}
|
||||
heap_free(array);
|
||||
*psia = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue