util: unlock closeCallbacks if get callbacks for connect fail

Avoid return with the closeCallbacks locked when get callbacks list for connect fail.

Signed-off-by: Wang King <king.wang@huawei.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Wang King 2017-01-10 14:23:49 +08:00 committed by John Ferlan
parent 980f2a35c7
commit a563451e2b

View File

@ -331,8 +331,10 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
virObjectLock(closeCallbacks); virObjectLock(closeCallbacks);
list = virCloseCallbacksGetForConn(closeCallbacks, conn); list = virCloseCallbacksGetForConn(closeCallbacks, conn);
if (!list) if (!list) {
virObjectLock(closeCallbacks);
return; return;
}
for (i = 0; i < list->nentries; i++) { for (i = 0; i < list->nentries; i++) {
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];