From 00fa155578252558b8995722266c467bc11d932b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 17 May 2011 09:12:16 -0600 Subject: [PATCH] openvz: fix logic bug in previous patch We want to free names on failure, not on success. * src/openvz/openvz_driver.c (openvzListDefinedDomains): Use correct condition. --- src/openvz/openvz_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index cefba1691c..ae951a28dc 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -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]); }