mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
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:
parent
8f147d16f1
commit
7cfbb17978
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user