[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/34] block/nbd: fix channel object leak
From: |
Eric Blake |
Subject: |
[PULL 04/34] block/nbd: fix channel object leak |
Date: |
Tue, 15 Jun 2021 15:47:26 -0500 |
From: Roman Kagan <rvkagan@yandex-team.ru>
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>
---
block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/nbd.c b/block/nbd.c
index 616f9ae6c4da..f4b3407587df 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);
--
2.31.1
- [PULL 00/34] NBD patches for 2021-06-15, Eric Blake, 2021/06/15
- [PULL 03/34] co-queue: drop extra coroutine_fn marks, Eric Blake, 2021/06/15
- [PULL 02/34] tests: cover aio_co_enter from a worker thread without BQL taken, Eric Blake, 2021/06/15
- [PULL 04/34] block/nbd: fix channel object leak,
Eric Blake <=
- [PULL 01/34] async: the main AioContext is only "current" if under the BQL, Eric Blake, 2021/06/15
- [PULL 05/34] block/nbd: fix how state is cleared on nbd_open() failure paths, Eric Blake, 2021/06/15
- [PULL 07/34] qemu-sockets: introduce socket_address_parse_named_fd(), Eric Blake, 2021/06/15
- [PULL 06/34] block/nbd: connect_thread_func(): do qio_channel_set_delay(false), Eric Blake, 2021/06/15
- [PULL 10/34] block/nbd: nbd_client_handshake(): fix leak of s->ioc, Eric Blake, 2021/06/15
- [PULL 09/34] block/nbd: ensure ->connection_thread is always valid, Eric Blake, 2021/06/15
- [PULL 08/34] block/nbd: call socket_address_parse_named_fd() in advance, Eric Blake, 2021/06/15
- [PULL 11/34] block/nbd: BDRVNBDState: drop unused connect_err and connect_status, Eric Blake, 2021/06/15
- [PULL 12/34] block/nbd: simplify waking of nbd_co_establish_connection(), Eric Blake, 2021/06/15
- [PULL 13/34] block/nbd: drop thr->state, Eric Blake, 2021/06/15