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:
Willy Tarreau 2017-11-05 10:35:57 +01:00
parent 70124ce3e1
commit 5ec84574c7

View File

@ -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;
}