1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 13:17:58 +03:00

storage: sheepdog: Avoid skipping variable initialization

Commit 155ca616eb added a error message
that skips initialization of the 'cmd' variable. Fortunately it was not
released.
This commit is contained in:
Peter Krempa 2015-03-02 10:09:49 +01:00
parent 723522328f
commit 1fcb9351d7

View File

@ -263,6 +263,7 @@ virStorageBackendSheepdogBuildVol(virConnectPtr conn,
unsigned int flags)
{
int ret = -1;
virCommandPtr cmd = NULL;
virCheckFlags(0, -1);
@ -272,7 +273,7 @@ virStorageBackendSheepdogBuildVol(virConnectPtr conn,
goto cleanup;
}
virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "create", vol->name, NULL);
cmd = virCommandNewArgList(COLLIE, "vdi", "create", vol->name, NULL);
virCommandAddArgFormat(cmd, "%llu", vol->target.capacity);
virStorageBackendSheepdogAddHostArg(cmd, pool);
if (virCommandRun(cmd, NULL) < 0)