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.
This commit is contained in:
Eric Blake 2011-05-17 09:12:16 -06:00
parent 1ccc16c603
commit 00fa155578

View 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]);
}