[PATCH 6/6] Fix couple imagelist leaks (Valgrind)

Nikolay Sivov nsivov at codeweavers.com
Sat Jan 15 09:21:54 CST 2011


---
 dlls/comctl32/imagelist.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index ed92a52..66cd03d 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -3384,7 +3384,12 @@ static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1,
 
     /* Get the interface for the new image list */
     if (hNew)
+    {
+        IImageList *imerge = (IImageList*)hNew;
+
         ret = HIMAGELIST_QueryInterface(hNew, riid, ppv);
+        IImageList_Release(imerge);
+    }
 
     IImageList_Release(iml2);
     return ret;
@@ -3534,7 +3539,12 @@ static HRESULT WINAPI ImageListImpl_GetDragImage(IImageList *iface, POINT *ppt,
 
     /* Get the interface for the new image list */
     if (hNew)
+    {
+        IImageList *idrag = (IImageList*)hNew;
+
         ret = HIMAGELIST_QueryInterface(hNew, riid, ppv);
+        IImageList_Release(idrag);
+    }
 
     return ret;
 }
-- 
1.5.6.5


--------------080102050901020309070409--



More information about the wine-patches mailing list