mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user