Uses the same concept from the last commit.
Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/shell32/shellitem.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index 8e66c6ab31a..e6620c41e50 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1286,16 +1286,13 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, if(SUCCEEDED(ret)) { ret = create_shellitemarray(array, cidl, ppsiItemArray); - if(SUCCEEDED(ret)) - { - heap_free(array); - return ret; - } }
- /* Something failed, clean up. */ - 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]); + } heap_free(array); return ret; } -- 2.36.0