Re: [PATCH 1/3] parallels: fix prlsdkAddDomain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



21.05.2015 9:50, Dmitry Guryanov пишет:

On 05/18/2015 05:44 PM, Maxim Nestratov wrote:
Don't forget to unlock domain on error path

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
  src/parallels/parallels_sdk.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 786e0ad..faae1ae 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -1443,8 +1443,10 @@ prlsdkAddDomain(parallelsConnPtr privconn, const unsigned char *uuid)
      }
        sdkdom = prlsdkSdkDomainLookupByUUID(privconn, uuid);
-    if (sdkdom == PRL_INVALID_HANDLE)
+    if (sdkdom == PRL_INVALID_HANDLE) {
+        virObjectUnlock(dom);
          return NULL;
+    }
        dom = prlsdkLoadDomain(privconn, sdkdom, NULL);
      PrlHandle_Free(sdkdom);
Is it really needed? dom is always NULL on this error path.
Ah, sure. You are right. This patch can be skipped
    dom = virDomainObjListFindByUUID(privconn->domains, uuid);
    if (dom) {
        /* domain is already in the list */
        return dom;
    }

    sdkdom = prlsdkSdkDomainLookupByUUID(privconn, uuid);
    if (sdkdom == PRL_INVALID_HANDLE)
        return NULL;
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]