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))
|
if(SUCCEEDED(ret))
|
||||||
{
|
{
|
||||||
ret = create_shellitemarray(array, cidl, psia);
|
ret = create_shellitemarray(array, cidl, psia);
|
||||||
heap_free(array);
|
|
||||||
if(SUCCEEDED(ret))
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FAILED(ret))
|
||||||
|
{
|
||||||
for(i = 0; i < cidl; i++)
|
for(i = 0; i < cidl; i++)
|
||||||
if(array[i]) IShellItem_Release(array[i]);
|
if(array[i]) IShellItem_Release(array[i]);
|
||||||
heap_free(array);
|
|
||||||
*psia = NULL;
|
*psia = NULL;
|
||||||
|
}
|
||||||
|
heap_free(array);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue