commit 7cfbb17978c467625afab866b7a22119789abee0 Author: Matthias Bolte Date: Thu Nov 26 00:09:40 2009 +0100 xen: Fix unconditional freeing in xenDaemonListDefinedDomains() Commit 790f0b3057787bb64da8c46c111ff8d3eff7b2af 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 diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index e370eb8..4d9dcd1 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -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; } /**