Fix a bug in the UUID assigner
In the UUID assigner, malloc() was used somewhere where it would have been correct to use realloc().
This commit is contained in:
parent
e3e4e5ee84
commit
81e10aa64b
|
@ -65,7 +65,11 @@ vx_uuid_block_s * vx_allocate_new_id_block(vx_uuid_table_s *table)
|
||||||
if(table->num_blocks >= table->block_capacity)
|
if(table->num_blocks >= table->block_capacity)
|
||||||
{
|
{
|
||||||
table->block_capacity *= 2;
|
table->block_capacity *= 2;
|
||||||
table->blocks = malloc(table->block_capacity * sizeof(vx_uuid_block_s *));
|
if( ! table->block_capacity)
|
||||||
|
{
|
||||||
|
table->block_capacity = 32;
|
||||||
|
}
|
||||||
|
table->blocks = realloc(table->blocks, table->block_capacity * sizeof(vx_uuid_block_s *));
|
||||||
}
|
}
|
||||||
table->blocks[table->num_blocks] = malloc(sizeof(vx_uuid_block_s));
|
table->blocks[table->num_blocks] = malloc(sizeof(vx_uuid_block_s));
|
||||||
block = table->blocks[table->num_blocks];
|
block = table->blocks[table->num_blocks];
|
||||||
|
|
Loading…
Reference in New Issue