mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Check for successful calloc of hash table only after performing it.
This commit is contained in:
parent
5591639863
commit
0b8c0818a0
3
rzip.c
3
rzip.c
|
|
@ -605,10 +605,9 @@ static bool hash_search(rzip_control *control, struct rzip_state *st, double pct
|
|||
/* 66% full at max. */
|
||||
st->hash_limit = (1 << st->hash_bits) / 3 * 2;
|
||||
st->hash_table = calloc(sizeof(st->hash_table[0]), (1 << st->hash_bits));
|
||||
}
|
||||
|
||||
if (unlikely(!st->hash_table))
|
||||
fatal_return(("Failed to allocate hash table in hash_search\n"), false);
|
||||
}
|
||||
|
||||
st->minimum_tag_mask = tag_mask;
|
||||
st->tag_clean_ptr = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue