From 16901659588c14b8336e5b2d1a5ace985c72e1f8 Mon Sep 17 00:00:00 2001 From: Fabian Maurer Date: Tue, 26 Apr 2022 21:03:20 +0200 Subject: [PATCH] shell32: Refactor to keep style consistent. Signed-off-by: Fabian Maurer Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- 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 ada98705483..3e8bd24a429 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -1336,16 +1336,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; }