[PATCH] oleaut32: avoid memory leaking junk (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Jun 9 13:47:00 CDT 2013


 1030107 Resource leak

Ciao, Marcus
---
 dlls/oleaut32/typelib.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index c2c3a63..024df0d 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -9771,6 +9771,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface)
             FILE_ATTRIBUTE_NORMAL, 0);
     if (outfile == INVALID_HANDLE_VALUE){
         WMSFT_free_file(&file);
+        heap_free(junk);
         return TYPE_E_IOERROR;
     }
 
@@ -9778,10 +9779,12 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface)
     if (!br) {
         WMSFT_free_file(&file);
         CloseHandle(outfile);
+        heap_free(junk);
         return TYPE_E_IOERROR;
     }
 
     br = WriteFile(outfile, junk, junk_size, &written, NULL);
+    heap_free(junk);
     if (!br) {
         WMSFT_free_file(&file);
         CloseHandle(outfile);
-- 
1.7.10.4




More information about the wine-patches mailing list