diff options
author | Roman Kagan <rvkagan@yandex-team.ru> | 2021-06-10 13:07:32 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2021-06-18 10:59:52 -0500 |
commit | 3687ad49038e13103f7382316e16dff79abddf95 (patch) | |
tree | ff796a4c26f93edb01d1516d37b9a112ab0f2e7f /block | |
parent | 0e70260b65814fe7c016a63c3081ac39617294a0 (diff) |
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 <rvkagan@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210610100802.5888-3-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); |