msi: Fix a crash when freeing memory.
This commit is contained in:
parent
a277da5b48
commit
8fb7fdd029
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user