parallels: don't forget to unlock domain if unregister fails

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
This commit is contained in:
Maxim Nestratov 2015-03-13 18:40:41 +03:00 committed by Michal Privoznik
parent 7bf69e0208
commit 2765fb72bd

View File

@ -948,6 +948,7 @@ parallelsDomainUndefineFlags(virDomainPtr domain,
{
parallelsConnPtr privconn = domain->conn->privateData;
virDomainObjPtr dom = NULL;
int ret;
virCheckFlags(0, -1);
@ -957,7 +958,11 @@ parallelsDomainUndefineFlags(virDomainPtr domain,
return -1;
}
return prlsdkUnregisterDomain(privconn, dom);
ret = prlsdkUnregisterDomain(privconn, dom);
if (ret)
virObjectUnlock(dom);
return ret;
}
static int