BUG/MEDIUM: server: fix potential null-deref after previous fix
authorWilly Tarreau <w@1wt.eu>
Thu, 22 May 2025 16:09:12 +0000 (18:09 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 May 2025 12:08:46 +0000 (14:08 +0200)
commitd883c7113fc28d48468c4cc5dc0a27ad3b122497
tree2e52ad8539e920c504c05f34de98bf884667cc4d
parentdfde7bd6b0b6f5e87e4ab65059f9a86219c55c95
BUG/MEDIUM: server: fix potential null-deref after previous fix

A valid build warning was reported in the CI with latest commit b40ce97ecc
("BUG/MEDIUM: server: fix crash after duplicate GUID insertion"). Indeed,
if the first test in the function fails, we branch to the err label
with guid==NULL and will crash there. Let's just test guid before
dereferencing it for freeing.

This needs to be backported to 3.0 as well since the commit above was
meant to go there.

(cherry picked from commit 28c7a22790a587c6a3ee1652188ad6786d59b687)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/guid.c