]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
openvz: fix logic bug in previous patch
authorEric Blake <eblake@redhat.com>
Tue, 17 May 2011 15:12:16 +0000 (09:12 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 17 May 2011 15:12:16 +0000 (09:12 -0600)
We want to free names on failure, not on success.

* src/openvz/openvz_driver.c (openvzListDefinedDomains): Use
correct condition.

src/openvz/openvz_driver.c

index cefba1691c57b082e1f233fff8a318a0b6c2b8fa..ae951a28dc8c3cd8d15722b6ca1cd6cc66a49d4b 100644 (file)
@@ -1492,7 +1492,7 @@ static int openvzListDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED,
 out:
     VIR_FORCE_CLOSE(outfd);
     virCommandFree(cmd);
-    if (rc >= 0) {
+    if (rc < 0) {
         for ( ; got >= 0 ; got--)
             VIR_FREE(names[got]);
     }