[PATCH] msi: free rec in error exit (Coverity)

Marcus Meissner marcus at jet.franken.de
Thu Jun 11 09:57:34 CDT 2015


1287106 Resource leak
---
 dlls/msi/patch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c
index 5456359..f8f3eaf 100644
--- a/dlls/msi/patch.c
+++ b/dlls/msi/patch.c
@@ -710,7 +710,10 @@ static UINT patch_add_media( MSIPACKAGE *package, IStorage *storage, MSIPATCHINF
             msiobj_release( &rec->hdr );
             continue;
         }
-        if (!(media = msi_alloc( sizeof( *media )))) goto done;
+        if (!(media = msi_alloc( sizeof( *media )))) {
+            msiobj_release( &rec->hdr );
+            goto done;
+	}
         media->disk_id = disk_id;
         media->last_sequence = MSI_RecordGetInteger( rec, 2 );
         media->prompt  = msi_dup_record_field( rec, 3 );
-- 
1.8.4.5




More information about the wine-patches mailing list