tests: storagevolxml2argvtest: do not reuse cmd

Reduce the scope of the variable to avoid mixing automatic and manual
cleanup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2021-12-13 19:31:11 +01:00
parent 8843cd113e
commit 7e41c10b95

View File

@ -50,7 +50,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
g_autoptr(virStorageVolDef) vol = NULL;
g_autoptr(virStorageVolDef) inputvol = NULL;
g_autoptr(virStoragePoolDef) inputpool = NULL;
g_autoptr(virCommand) cmd = NULL;
if (!(def = virStoragePoolDefParseFile(poolxml)))
goto cleanup;
@ -88,7 +87,8 @@ testCompareXMLToArgvFiles(bool shouldFail,
convertStep = VIR_STORAGE_VOL_ENCRYPT_CREATE;
do {
virCommandFree(cmd);
g_autoptr(virCommand) cmd = NULL;
cmd = virStorageBackendCreateQemuImgCmdFromVol(obj, vol,
inputvol, flags,
create_tool,