]> git.proxmox.com Git - mirror_qemu.git/commitdiff
multifd/tls: fix memoryleak of the QIOChannelSocket object when cancelling migration
authorChuan Zheng <zhengchuan@huawei.com>
Wed, 11 Nov 2020 14:26:03 +0000 (22:26 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 12 Nov 2020 15:52:20 +0000 (15:52 +0000)
When creating new tls client, the tioc->master will be referenced which results in socket
leaking after multifd_save_cleanup if we cancel migration.
Fix it by do object_unref() after tls client creation.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Message-Id: <1605104763-118687-1-git-send-email-zhengchuan@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/multifd.c

index 88486b90d6ce273729ad270850e599fbee664fc3..45c690aa1136b9802c9c5695446fc835a29f9c26 100644 (file)
@@ -765,6 +765,7 @@ static void multifd_tls_channel_connect(MultiFDSendParams *p,
         return;
     }
 
+    object_unref(OBJECT(ioc));
     trace_multifd_tls_outgoing_handshake_start(ioc, tioc, hostname);
     qio_channel_set_name(QIO_CHANNEL(tioc), "multifd-tls-outgoing");
     p->c = QIO_CHANNEL(tioc);