mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
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.
This commit is contained in:
parent
b40ce97ecc
commit
28c7a22790
@ -75,7 +75,8 @@ int guid_insert(enum obj_type *objt, const char *uid, char **errmsg)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ha_free(&guid->node.key);
|
if (guid)
|
||||||
|
ha_free(&guid->node.key);
|
||||||
ha_free(&dup_name);
|
ha_free(&dup_name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user