From: Fabiano Rosas Date: Mon, 17 Jun 2024 18:57:16 +0000 (-0300) Subject: migration: Drop reference to QIOChannel if file seeking fails X-Git-Tag: qemu-xen-4.20.0~105^2~27 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a701c03decf140c7666edee1301e151714e50a72;p=qemu-xen.git migration: Drop reference to QIOChannel if file seeking fails We forgot to drop the reference to the QIOChannel in the error path of the offset adjustment. Do it now. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- diff --git a/migration/file.c b/migration/file.c index ab18ba505a..2bb8c64092 100644 --- a/migration/file.c +++ b/migration/file.c @@ -94,6 +94,7 @@ void file_start_outgoing_migration(MigrationState *s, ioc = QIO_CHANNEL(fioc); if (offset && qio_channel_io_seek(ioc, offset, SEEK_SET, errp) < 0) { + object_unref(OBJECT(fioc)); return; } qio_channel_set_name(ioc, "migration-file-outgoing");