util/hash.c: fix use after free (not quite)
Dereference of 'h' after calling freeMagic(h) Found while putting in cast. Initially this is what was thought however.... freeMagic() has this one allocation to free latency, which is a matter to resolve another day.
This commit is contained in:
parent
fadd2d98b4
commit
bbc52ecd41
|
|
@ -692,9 +692,10 @@ HashKill(table)
|
|||
for (hp = table->ht_table, hend = &hp[table->ht_size]; hp < hend; hp++)
|
||||
for (h = *hp; h != NIL; h = h->h_next)
|
||||
{
|
||||
const void *p = h->h_key.h_ptr;
|
||||
freeMagic((char *) h);
|
||||
if (killFn)
|
||||
(*killFn)(h->h_key.h_ptr);
|
||||
(*killFn)((void *)p);
|
||||
}
|
||||
freeMagic((char *) table->ht_table);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue