qemu_snapshot: revert: use g_autoptr

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Pavel Hrdina 2021-11-25 16:44:23 +01:00
parent 0bf41434d9
commit ebdd9a5842

View File

@ -1940,8 +1940,8 @@ qemuSnapshotRevert(virDomainObj *vm,
int detail;
qemuDomainObjPrivate *priv = vm->privateData;
int rc;
virDomainDef *config = NULL;
virDomainDef *inactiveConfig = NULL;
g_autoptr(virDomainDef) config = NULL;
g_autoptr(virDomainDef) inactiveConfig = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
qemuDomainSaveCookie *cookie;
unsigned int start_flags = VIR_QEMU_PROCESS_START_GEN_VMID;
@ -2233,8 +2233,6 @@ qemuSnapshotRevert(virDomainObj *vm,
}
virObjectEventStateQueue(driver->domainEventState, event);
virObjectEventStateQueue(driver->domainEventState, event2);
virDomainDefFree(config);
virDomainDefFree(inactiveConfig);
return ret;
}