wbemprox: Make sure to allocate sufficient memory in resize_table.

This commit is contained in:
Hans Leidekker 2015-04-02 16:16:04 +02:00 committed by Alexandre Julliard
parent 287d419e5e
commit 3c5ef7c4ad
1 changed files with 2 additions and 2 deletions

View File

@ -1018,10 +1018,10 @@ static BOOL resize_table( struct table *table, UINT row_count, UINT row_size )
table->num_rows_allocated = row_count;
return TRUE;
}
if (row_count >= table->num_rows_allocated)
if (row_count > table->num_rows_allocated)
{
BYTE *data;
UINT count = table->num_rows_allocated * 2;
UINT count = max( row_count, table->num_rows_allocated * 2 );
if (!(data = heap_realloc( table->data, count * row_size ))) return FALSE;
table->data = data;
table->num_rows_allocated = count;