>From 69b262fd09fee2ad403a7ff9168ee576309b1119 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Rico=20Sch=C3=BCller?= <kgbricola@web.de>
Date: Mon, 31 Dec 2007 01:34:00 +0100
Subject: [PATCH] msi: Fix memory leak (found by Smatch)

---
 dlls/msi/source.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 68f94b5..62861d9 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -605,7 +605,10 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
 
         entry->path = msi_alloc(val_size);
         if (!entry->path)
+        {
+            msi_free(entry);
             goto error;
+        }
 
         lstrcpyW(entry->szIndex, name);
         entry->index = atoiW(name);
@@ -614,7 +617,11 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
         r = RegEnumValueW(sourcekey, index, name, &size, NULL,
                           NULL, (LPBYTE)entry->path, &val_size);
         if (r != ERROR_SUCCESS)
+        {
+            msi_free(entry->path);
+            msi_free(entry);
             goto error;
+        }
 
         index = ++(*count);
         add_source_to_list(sourcelist, entry);
-- 
1.5.3.3

