mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-23 19:03:06 -04:00
MINOR: pools: add a new flag to declare static registrations
We must not free these ones when destroying a pool, so let's dedicate them a flag to mention that they are static. For now we don't have any such.
This commit is contained in:
parent
18505f9718
commit
ee5bc28865
2 changed files with 3 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#define MEM_F_SHARED 0x1
|
||||
#define MEM_F_EXACT 0x2
|
||||
#define MEM_F_UAF 0x4
|
||||
#define MEM_F_STATREG 0x8 /* static registration: do not free it! */
|
||||
|
||||
/* A special pointer for the pool's free_list that indicates someone is
|
||||
* currently manipulating it. Serves as a short-lived lock.
|
||||
|
|
|
|||
|
|
@ -1049,7 +1049,8 @@ void *pool_destroy(struct pool_head *pool)
|
|||
|
||||
list_for_each_entry_safe(reg, back, &pool->regs, list) {
|
||||
LIST_DELETE(®->list);
|
||||
free(reg);
|
||||
if (!(reg->flags & MEM_F_STATREG))
|
||||
free(reg);
|
||||
}
|
||||
|
||||
LIST_DELETE(&pool->list);
|
||||
|
|
|
|||
Loading…
Reference in a new issue