ole32: Fix some leaks (coverity)

Frédéric Delanoy frederic.delanoy at gmail.com
Thu Nov 8 03:21:59 CST 2012


CIDs 713625-713627
---
 dlls/ole32/storage32.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index d2e9f69..34e18bc 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -8756,15 +8756,27 @@ HRESULT WINAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT* pcf, LPOLESTR* lp
 
     r = STREAM_ReadString( stm, &szOleTypeName );
     if( FAILED( r ) )
+    {
+        CoTaskMemFree(szCLSIDName);
         goto end;
+    }
 
     r = STREAM_ReadString( stm, &szProgIDName );
     if( FAILED( r ) )
+    {
+        CoTaskMemFree(szCLSIDName);
+        CoTaskMemFree(szOleTypeName);
         goto end;
+    }
 
     r = IStream_Read( stm, unknown2, sizeof(unknown2), &count );
     if( FAILED( r ) || ( count != sizeof(unknown2) ) )
+    {
+        CoTaskMemFree(szCLSIDName);
+        CoTaskMemFree(szOleTypeName);
+        CoTaskMemFree(szProgIDName);
         goto end;
+    }
 
     /* ok, success... now we just need to store what we found */
     if( pcf )
-- 
1.8.0




More information about the wine-patches mailing list