Valgrind found this uninitialized block of memory

This commit is contained in:
Tony Garnock-Jones 2010-12-30 00:31:25 -05:00
parent 420d53c511
commit 66c19fea96
1 changed files with 1 additions and 2 deletions

View File

@ -36,8 +36,7 @@ void init_hashtable(hashtable_t *table,
table->free_value = free_value;
if (initial_bucket_count > 0) {
table->buckets = realloc(table->buckets,
initial_bucket_count * sizeof(hashtable_entry_t *));
table->buckets = calloc(initial_bucket_count, sizeof(hashtable_entry_t *));
}
}