migration: Drop reference to QIOChannel if file seeking fails
authorFabiano Rosas <farosas@suse.de>
Mon, 17 Jun 2024 18:57:16 +0000 (15:57 -0300)
committerFabiano Rosas <farosas@suse.de>
Thu, 20 Jun 2024 13:42:23 +0000 (10:42 -0300)
We forgot to drop the reference to the QIOChannel in the error path of
the offset adjustment. Do it now.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
migration/file.c

index ab18ba505a1d2d860898279a7230b137f0011e07..2bb8c64092a0268f284b9418a207f8f5bdfcedcd 100644 (file)
@@ -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");