]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: storagevolxml2argvtest: do not reuse cmd
authorJán Tomko <jtomko@redhat.com>
Mon, 13 Dec 2021 18:31:11 +0000 (19:31 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 14 Dec 2021 15:41:06 +0000 (16:41 +0100)
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>
tests/storagevolxml2argvtest.c

index 9597509f000d554afba4d6b89e9d8c6156453212..94e2de1730dd20ca7d580cca32afc25142dce26b 100644 (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,