From 3687ad49038e13103f7382316e16dff79abddf95 Mon Sep 17 00:00:00 2001 From: Roman Kagan Date: Thu, 10 Jun 2021 13:07:32 +0300 Subject: [PATCH] block/nbd: fix channel object leak nbd_free_connect_thread leaks the channel object if it hasn't been stolen. Unref it and fix the leak. Signed-off-by: Roman Kagan Reviewed-by: Eric Blake Message-Id: <20210610100802.5888-3-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake --- block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd.c b/block/nbd.c index 616f9ae6c4..f4b3407587 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -381,6 +381,7 @@ static void nbd_free_connect_thread(NBDConnectThread *thr) { if (thr->sioc) { qio_channel_close(QIO_CHANNEL(thr->sioc), NULL); + object_unref(OBJECT(thr->sioc)); } error_free(thr->err); qapi_free_SocketAddress(thr->saddr);