Hib Eris : msi: Fix a crash when freeing memory.

Alexandre Julliard julliard at winehq.org
Thu Jun 11 10:54:25 CDT 2009


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

Author: Hib Eris <hib at hiberis.nl>
Date:   Wed Jun 10 17:13:59 2009 +0200

msi: Fix a crash when freeing memory.

---

 dlls/msi/streams.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 2d869cc..12f707e 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -60,7 +60,7 @@ static BOOL streams_set_table_size(MSISTREAMSVIEW *sv, UINT size)
     if (size >= sv->max_streams)
     {
         sv->max_streams *= 2;
-        sv->streams = msi_realloc(sv->streams, sv->max_streams * sizeof(STREAM *));
+        sv->streams = msi_realloc_zero(sv->streams, sv->max_streams * sizeof(STREAM *));
         if (!sv->streams)
             return FALSE;
     }
@@ -387,7 +387,7 @@ static UINT STREAMS_delete(struct tagMSIVIEW *view)
 
     for (i = 0; i < sv->num_rows; i++)
     {
-        if (sv->streams[i]->stream)
+        if (sv->streams[i] && sv->streams[i]->stream)
             IStream_Release(sv->streams[i]->stream);
         msi_free(sv->streams[i]);
     }
@@ -462,7 +462,7 @@ static INT add_streams_to_table(MSISTREAMSVIEW *sv)
         return -1;
 
     sv->max_streams = 1;
-    sv->streams = msi_alloc(sizeof(STREAM *));
+    sv->streams = msi_alloc_zero(sizeof(STREAM *));
     if (!sv->streams)
         return -1;
 




More information about the wine-cvs mailing list