From 2765fb72bd294b0f1bede96b65bf52e39fbc48e6 Mon Sep 17 00:00:00 2001 From: Maxim Nestratov Date: Fri, 13 Mar 2015 18:40:41 +0300 Subject: [PATCH] parallels: don't forget to unlock domain if unregister fails Signed-off-by: Maxim Nestratov --- src/parallels/parallels_driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index bf29a96f9b..1a6d6e67f2 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -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