mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-29 15:40:11 +08:00
fix: hashtables on recsize < 4
This commit is contained in:
parent
a4527783d6
commit
d125261e8c
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user