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>
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;
convertStep = VIR_STORAGE_VOL_ENCRYPT_CREATE;
do {
- virCommandFree(cmd);
+ g_autoptr(virCommand) cmd = NULL;
+
cmd = virStorageBackendCreateQemuImgCmdFromVol(obj, vol,
inputvol, flags,
create_tool,