summaryrefslogtreecommitdiffstats
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorAlex Chen2020-11-30 13:36:51 +0100
committerEric Blake2021-01-20 21:48:05 +0100
commit992809bf8bfa4a6ba0765344fb11d41ae7db3280 (patch)
treea53a230fb83c68f3e5a9453ac14a4ad032c798f9 /qemu-nbd.c
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210119-... (diff)
downloadqemu-992809bf8bfa4a6ba0765344fb11d41ae7db3280.tar.gz
qemu-992809bf8bfa4a6ba0765344fb11d41ae7db3280.tar.xz
qemu-992809bf8bfa4a6ba0765344fb11d41ae7db3280.zip
qemu-nbd: Fix a memleak in qemu_nbd_client_list()
When the qio_channel_socket_connect_sync() fails we should goto 'out' label to free the 'sioc' instead of return. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Message-Id: <20201130123651.17543-1-alex.chen@huawei.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index a7075c5419..47587a709e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -181,7 +181,7 @@ static int qemu_nbd_client_list(SocketAddress *saddr, QCryptoTLSCreds *tls,
sioc = qio_channel_socket_new();
if (qio_channel_socket_connect_sync(sioc, saddr, &err) < 0) {
error_report_err(err);
- return EXIT_FAILURE;
+ goto out;
}
rc = nbd_receive_export_list(QIO_CHANNEL(sioc), tls, hostname, &list,
&err);