ole32: Fix outstanding memory leak (coverity)

André Hentschel nerv at dawncrow.de
Sat Nov 10 08:57:13 CST 2012


---
 dlls/ole32/storage32.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 8498eaf..4099df6 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -9067,17 +9067,16 @@ static HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DW
     else
     {
         STATSTG stat;
-        LPOLESTR wstrProgID;
+        LPOLESTR wstrProgID = NULL;
 
         /* Get the OleType from the registry */
         REFCLSID clsid = &(stat.clsid);
         IStorage_Stat(pStorage, &stat, STATFLAG_NONAME);
         hRes = ProgIDFromCLSID(clsid, &wstrProgID);
         if(hRes == S_OK)
-        {
             *dwSize = WideCharToMultiByte(CP_ACP, 0, wstrProgID, -1, strProgID, *dwSize, NULL, FALSE);
+        if(wstrProgID)
             CoTaskMemFree(wstrProgID);
-        }
 
     }
     return hRes;
-- 
1.8.0



-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list