Rico Schüller : msi: Fix memory leaks (found by Smatch ).

Alexandre Julliard julliard at winehq.org
Mon Jan 7 08:39:28 CST 2008


Module: wine
Branch: master
Commit: 63c5e152a1b02dddee3cc7964d0b3e80c297dd9d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=63c5e152a1b02dddee3cc7964d0b3e80c297dd9d

Author: Rico Schüller <kgbricola at web.de>
Date:   Mon Dec 31 01:04:56 2007 +0100

msi: Fix memory leaks (found by Smatch).

---

 dlls/msi/dialog.c |    3 +++
 dlls/msi/source.c |    7 +++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 4417d4b..4ab25f9 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2268,7 +2268,10 @@ static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
 
     control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style );
     if (!control)
+    {
+        msi_free(info);
         return ERROR_FUNCTION_FAILED;
+    }
 
     control->handler = msi_dialog_listbox_handler;
 
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 68f94b5..fcdd35d 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);




More information about the wine-cvs mailing list