mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 23:44:41 +00:00
BUG/MAJOR: threads/dns: add missing unlock on allocation failure path
An unlock was missing when a memory allocation failure is detected.
This commit is contained in:
parent
70124ce3e1
commit
5ec84574c7
@ -1347,8 +1347,10 @@ int dns_link_resolution(void *requester, int requester_type)
|
||||
if (srv) {
|
||||
SPIN_LOCK(SERVER_LOCK, &srv->lock);
|
||||
if (srv->dns_requester == NULL) {
|
||||
if ((req = calloc(1, sizeof(*req))) == NULL)
|
||||
if ((req = calloc(1, sizeof(*req))) == NULL) {
|
||||
SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
|
||||
goto err;
|
||||
}
|
||||
req->owner = &srv->obj_type;
|
||||
srv->dns_requester = req;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user