From: Kirill Shchetiniuk <[email protected]>
Signed-off-by: Kirill Shchetiniuk <[email protected]>
---
src/qemu/qemu_migration.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 39beecc7e9..06b8f388fe 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4451,7 +4451,7 @@ static qemuMigrationIOThread *
qemuMigrationSrcStartTunnel(virStreamPtr st,
int sock)
{
- qemuMigrationIOThread *io = NULL;
+ g_autofree qemuMigrationIOThread *io = NULL;
int wakeupFD[2] = { -1, -1 };
if (virPipe(wakeupFD) < 0)
@@ -4474,12 +4474,11 @@ qemuMigrationSrcStartTunnel(virStreamPtr st,
goto error;
}
- return io;
+ return g_steal_pointer(&io);
error:
VIR_FORCE_CLOSE(wakeupFD[0]);
VIR_FORCE_CLOSE(wakeupFD[1]);
- VIR_FREE(io);
return NULL;
}
--
2.49.0