mirror of https://gitee.com/openkylin/qemu.git
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:
parent
0e70260b65
commit
3687ad4903
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue