From 8ddb00b22b02004640c6c316faacf6d971ed2620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Mon, 26 Nov 2012 12:41:42 +0100 Subject: [PATCH] ole32: Fix some leaks (coverity). --- dlls/ole32/filemoniker.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c index 37c86ca0a94..7a97100dcc7 100644 --- a/dlls/ole32/filemoniker.c +++ b/dlls/ole32/filemoniker.c @@ -973,10 +973,17 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p return nb1; nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2); if (FAILED(nb2)) + { + free_stringtable(stringTable1); return nb2; + } if (nb1==0 || nb2==0) + { + free_stringtable(stringTable1); + free_stringtable(stringTable2); return MK_E_NOPREFIX; + } commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1)); if (!commonPath) @@ -1136,10 +1143,15 @@ FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppm return res; len1=FileMonikerImpl_DecomposePath(str1,&tabStr1); + if (FAILED(len1)) + return E_OUTOFMEMORY; len2=FileMonikerImpl_DecomposePath(str2,&tabStr2); - if (FAILED(len1) || FAILED(len2)) - return E_OUTOFMEMORY; + if (FAILED(len2)) + { + free_stringtable(tabStr1); + return E_OUTOFMEMORY; + } /* count the number of similar items from the begin of the two paths */ for(sameIdx=0; ( (tabStr1[sameIdx]!=NULL) &&