From: Ján Tomko Date: Mon, 13 Dec 2021 18:31:11 +0000 (+0100) Subject: tests: storagevolxml2argvtest: do not reuse cmd X-Git-Tag: v8.0.0-rc1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e41c10b952751360db2069adcc8373094964e62;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Michal Privoznik --- diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 9597509f00..94e2de1730 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -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,