Lionel Debroux : ole32: Fix memory leak in compositemoniker.c ( found by Smatch).

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 11 07:28:38 CDT 2007


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

Author: Lionel Debroux <lionel_debroux at yahoo.fr>
Date:   Sat Sep  1 16:36:11 2007 +0200

ole32: Fix memory leak in compositemoniker.c (found by Smatch).

---

 dlls/ole32/compositemoniker.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c
index 4a0af25..c49e9b8 100644
--- a/dlls/ole32/compositemoniker.c
+++ b/dlls/ole32/compositemoniker.c
@@ -1786,8 +1786,10 @@ CompositeMonikerImpl_Construct(IMoniker** ppMoniker,
     This->tabLastIndex=0;
 
     This->tabMoniker=HeapAlloc(GetProcessHeap(),0,This->tabSize*sizeof(IMoniker));
-    if (This->tabMoniker==NULL)
+    if (This->tabMoniker==NULL) {
+        HeapFree(GetProcessHeap(), 0, This);
         return E_OUTOFMEMORY;
+    }
 
     if (!pmkFirst && !pmkRest)
     {




More information about the wine-cvs mailing list