If virCloseCallbacksSet fails, qemuMigrationBegin must return NULL to
indicate an error occurred.
Signed-off-by: Michael Chapman <mike(a)very.puzzling.org>
---
src/qemu/qemu_migration.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 9458606..21432c0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2745,8 +2745,10 @@ qemuMigrationBegin(virConnectPtr conn,
* place.
*/
if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn,
- qemuMigrationCleanup) < 0)
+ qemuMigrationCleanup) < 0) {
+ VIR_FREE(xml);
goto endjob;
+ }
qemuMigrationJobContinue(vm);
} else {
goto endjob;
--
2.1.0