]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: proxy: detach the name node in proxy_free_common() instead
authorWilly Tarreau <w@1wt.eu>
Sat, 19 Apr 2025 08:21:19 +0000 (10:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 19 Apr 2025 08:21:19 +0000 (10:21 +0200)
commit5763a891a9b11961cad0cf6bae1ec079e0140d76
tree762f480cd8f5ba0cf92df7c903a84e70bdd1be93
parentd2a9149f09e7fe209b8e59781e82947412b24c66
CLEANUP: proxy: detach the name node in proxy_free_common() instead

This changes commit d2a9149f0 ("BUG/MINOR: proxy: always detach a proxy
from the names tree on free()") to be cleaner. AurĂ©lien spotted that
the free(p->id) was indeed already done in proxy_free_common(), which is
called before we delete the node. That's still a bit ugly and it only
works because ebpt_delete() does not dereference the key during the
operation. Better play safe and delete the entry before freeing it,
that's more future-proof.
src/proxy.c