mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
zfs: Resolve RESOURCE_LEAK
Found by my Coverity checker - virCheckFlags call could return -1, but not virCommandFree(destroy_cmd). Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
fe0063685a
commit
4e87164306
@ -355,10 +355,12 @@ virStorageBackendZFSDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
int ret = -1;
|
||||
virCommandPtr destroy_cmd = virCommandNewArgList(ZFS, "destroy", NULL);
|
||||
virCommandPtr destroy_cmd = NULL;
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
destroy_cmd = virCommandNewArgList(ZFS, "destroy", NULL);
|
||||
|
||||
virCommandAddArgFormat(destroy_cmd, "%s/%s",
|
||||
pool->def->source.name, vol->name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user