Re: [PATCH] ole32: Some missing error checking in FileMonikerImpl_CommonPrefixWith (Coverity)
2009/11/23 Marcus Meissner <marcus(a)jet.franken.de>:
if(mkSys==MKSYS_FILEMONIKER){ HRESULT ret;
- CreateBindCtx(0,&pbind); + ret = CreateBindCtx(0,&pbind); + if (FAILED(ret)) + return ret;
/* create a string based on common part of the two paths */
- IMoniker_GetDisplayName(iface,pbind,NULL,&pathThis); - IMoniker_GetDisplayName(pmkOther,pbind,NULL,&pathOther); + ret = IMoniker_GetDisplayName(iface,pbind,NULL,&pathThis); + if (FAILED(ret)) + return ret;
pbind is leaked here.
+ ret = IMoniker_GetDisplayName(pmkOther,pbind,NULL,&pathOther); + if (FAILED(ret)) + return ret;
pbind and pathThis are leaked here.
nb1=FileMonikerImpl_DecomposePath(pathThis,&stringTable1); + if (FAILED(nb1)) + return nb1;
Ditto plus pathOther.
nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2); + if (FAILED(nb2)) + return nb2;
Ditto plus stringTable1.
if (nb1==0 || nb2==0) return MK_E_NOPREFIX;
commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1)); + if (!commonPath) + return E_OUTOFMEMORY;
Ditto plus stringTable2.
*commonPath=0;
-- Rob Shearman
participants (1)
-
Rob Shearman