[PATCH 4/4] shell32: Release the returned imagelist.

Huw Davies huw at codeweavers.com
Tue Apr 25 03:04:59 CDT 2017


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/shell32/brsfolder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c
index 4040407650..a473874a6b 100644
--- a/dlls/shell32/brsfolder.c
+++ b/dlls/shell32/brsfolder.c
@@ -29,6 +29,7 @@
 
 #include "wine/debug.h"
 #include "undocshell.h"
+#include "commoncontrols.h"
 #include "pidl.h"
 #include "shell32_main.h"
 #include "shellapi.h"
@@ -282,7 +283,10 @@ static void InitializeTreeView( browse_info *info )
 static int GetIcon(LPCITEMIDLIST lpi, UINT uFlags)
 {
     SHFILEINFOW sfi;
-    SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags);
+    IImageList *list;
+
+    list = (IImageList *)SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags);
+    if (list) IImageList_Release(list);
     return sfi.iIcon;
 }
 
-- 
2.12.0




More information about the wine-patches mailing list