Sven Baars : shell32: Fix a use after free (Coverity).

Alexandre Julliard julliard at winehq.org
Wed May 29 15:50:37 CDT 2019


Module: wine
Branch: master
Commit: e6ce281d30e6a63fb5c84e0b9df72c35476e63f9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e6ce281d30e6a63fb5c84e0b9df72c35476e63f9

Author: Sven Baars <sven.wine at gmail.com>
Date:   Tue May 28 23:51:04 2019 +0200

shell32: Fix a use after free (Coverity).

Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/shellitem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
index fc95e7c..b9e4903 100644
--- a/dlls/shell32/shellitem.c
+++ b/dlls/shell32/shellitem.c
@@ -1289,9 +1289,11 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent,
     if(SUCCEEDED(ret))
     {
         ret = create_shellitemarray(array, cidl, ppsiItemArray);
-        heap_free(array);
         if(SUCCEEDED(ret))
+        {
+            heap_free(array);
             return ret;
+        }
     }
 
     /* Something failed, clean up. */




More information about the wine-cvs mailing list