提交 4e871643 编写于 作者: J John Ferlan

zfs: Resolve RESOURCE_LEAK

Found by my Coverity checker - virCheckFlags call could return -1, but
not virCommandFree(destroy_cmd).
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 fe006368
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册