msi: Avoid zero size allocations (Valgrind).

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2017-03-28 10:45:56 +02:00 committed by Alexandre Julliard
parent 0b95ebd283
commit d12728a872
1 changed files with 5 additions and 7 deletions

View File

@ -422,13 +422,11 @@ static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg
goto err;
}
t->row_count = rawsize / row_size;
t->data = msi_alloc_zero( t->row_count * sizeof (USHORT*) );
if( !t->data )
goto err;
t->data_persistent = msi_alloc_zero( t->row_count * sizeof(BOOL));
if ( !t->data_persistent )
goto err;
if ((t->row_count = rawsize / row_size))
{
if (!(t->data = msi_alloc_zero( t->row_count * sizeof(USHORT *) ))) goto err;
if (!(t->data_persistent = msi_alloc_zero( t->row_count * sizeof(BOOL) ))) goto err;
}
/* transpose all the data */
TRACE("Transposing data from %d rows\n", t->row_count );