MINOR: memory: also poison the area on freeing

Doing so sometimes helps detect some UAF situations without the overhead
associated to the DEBUG_UAF define.
This commit is contained in:
Willy Tarreau 2019-11-15 06:59:54 +01:00
parent 5de7817ae8
commit da52035a45

View File

@ -332,6 +332,8 @@ static inline void pool_free(struct pool_head *pool, void *ptr)
if (*POOL_LINK(pool, ptr) != (void *)pool)
*(volatile int *)0 = 0;
#endif
if (mem_poison_byte >= 0)
memset(ptr, mem_poison_byte, pool->size);
pool_put_to_cache(pool, ptr);
}
}