Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5b87aaf9c2..57c66c3401 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6695,7 +6695,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
int ret = -1;
g_autoptr(virQEMUSaveData) data = NULL;
virQEMUSaveHeaderPtr header;
- virDomainDefPtr def = NULL;
+ g_autoptr(virDomainDef) def = NULL;
int oflags = open_write ? O_RDWR : O_RDONLY;
size_t xml_len;
size_t cookie_len;
@@ -6809,13 +6809,12 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;
- *ret_def = def;
+ *ret_def = g_steal_pointer(&def);
*ret_data = g_steal_pointer(&data);
return fd;
error:
- virDomainDefFree(def);
VIR_FORCE_CLOSE(fd);
return ret;
}
--
2.26.0