From: Chuan Zheng <[email protected]>

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Ă© <[email protected]>
Signed-off-by: Chuan Zheng <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
---
 migration/multifd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/migration/multifd.c b/migration/multifd.c
index 88486b90d6..45c690aa11 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -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);
-- 
2.28.0


Reply via email to