xen: Fix unconditional freeing in xenDaemonListDefinedDomains()

Commit 790f0b3057 causes the contents of
the names array to be freed even on success, resulting in no listing of
defined but inactive Xen domains.

Spotted by Jim Fehlig
This commit is contained in:
Matthias Bolte 2009-11-26 00:09:40 +01:00
parent 8f147d16f1
commit 7cfbb17978

View File

@ -4696,12 +4696,17 @@ xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxnames
break;
}
cleanup:
sexpr_free(root);
return(ret);
error:
for (i = 0; i < ret; ++i)
VIR_FREE(names[i]);
sexpr_free(root);
return(ret);
ret = -1;
goto cleanup;
}
/**