diff mbox series

[PULL,08/11] vnc: Fix a memleak in vnc_display_connect()

Message ID 20210115102424.1360437-9-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/11] ui/gtk: don't try to redefine SI prefixes | expand

Commit Message

Gerd Hoffmann Jan. 15, 2021, 10:24 a.m. UTC
From: Alex Chen <alex.chen@huawei.com>

Free the 'sioc' when the qio_channel_socket_connect_sync() fails.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20201126065702.35095-1-alex.chen@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/vnc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index a0bf750767a2..d4854d351bac 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3805,6 +3805,7 @@  static int vnc_display_connect(VncDisplay *vd,
     sioc = qio_channel_socket_new();
     qio_channel_set_name(QIO_CHANNEL(sioc), "vnc-reverse");
     if (qio_channel_socket_connect_sync(sioc, saddr[0], errp) < 0) {
+        object_unref(OBJECT(sioc));
         return -1;
     }
     vnc_connect(vd, sioc, false, false);