fix: hashtables on recsize < 4

This commit is contained in:
Vladimir Dubrovin 2026-04-28 16:32:30 +03:00
parent a4527783d6
commit d125261e8c

View File

@ -74,7 +74,7 @@ int inithashtable(struct hashtable *ht, unsigned tablesize, unsigned poolsize, u
pthread_mutex_lock(&ht->hash_mutex); pthread_mutex_lock(&ht->hash_mutex);
} }
if(!(ht->ihashtable = myalloc(tablesize * sizeof(uint32_t))) if(!(ht->ihashtable = myalloc(tablesize * sizeof(uint32_t)))
|| !(ht->hashvalues = myalloc(poolsize * (sizeof(struct hashentry) + (ht->recsize-4)))) || !(ht->hashvalues = myalloc(poolsize * (sizeof(struct hashentry) + ht->recsize - 4)))
|| !(ht->hashhashvalues = myalloc(poolsize * ht->hash_size)) || !(ht->hashhashvalues = myalloc(poolsize * ht->hash_size))
){ ){
myfree(ht->ihashtable); myfree(ht->ihashtable);