BUG/MEDIUM: pools: fix ha_free() on area in the process of being freed
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Mar 2022 17:31:54 +0000 (18:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Mar 2022 09:50:29 +0000 (10:50 +0100)
commit2538f4a15bcf71bb4da19247aa3c3f854be670da
tree9cd3cc97de02d9087ee644fee38836efde7627a8
parent7ffffbd43e327b0a22ca23f7e8c28236b552ad93
BUG/MEDIUM: pools: fix ha_free() on area in the process of being freed

Commit e81248c0c ("BUG/MINOR: pool: always align pool_heads to 64 bytes")
added a free of the allocated pool in pool_destroy() using ha_free(), but
it added a subtle bug by which once the pool is released, setting its
address to NULL inside the structure itself cannot work because the area
has just been freed.

This will need to be backported wherever the patch above is backported.

(cherry picked from commit f9eba78fb82a9ccca2503e318a79be4d7db8d94d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/pool.c