fix: update all pool freelist initializations to reflect the new invariant (prevents null-pointer dereference crash)

This was SVN commit r9129.
This commit is contained in:
janwas 2011-03-28 21:10:41 +00:00
parent c396997009
commit fb872e0bd5

View File

@ -47,7 +47,7 @@ LibError pool_destroy(Pool* p)
// don't be picky and complain if the freelist isn't empty;
// we don't care since it's all part of the da anyway.
// however, zero it to prevent further allocs from succeeding.
p->freelist = 0;
p->freelist = mem_freelist_Sentinel();
return da_free(&p->da);
}
@ -112,7 +112,7 @@ void pool_free(Pool* p, void* el)
void pool_free_all(Pool* p)
{
p->freelist = 0;
p->freelist = mem_freelist_Sentinel();
// must be reset before da_set_size or CHECK_DA will complain.
p->da.pos = 0;