qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vnc: Fix a memleak in vnc_display_connect()
@ 2020-11-26  6:57 Alex Chen
  2020-11-26 10:32 ` Li Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Chen @ 2020-11-26  6:57 UTC (permalink / raw)
  To: kraxel; +Cc: alex.chen, qemu-trivial, qemu-devel, zhang.zhanghailiang

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>
---
 ui/vnc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index 49235056f7..dae56e9493 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3743,6 +3743,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);
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-12 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-26  6:57 [PATCH] vnc: Fix a memleak in vnc_display_connect() Alex Chen
2020-11-26 10:32 ` Li Qiang
2021-01-12 19:49 ` Laurent Vivier
2021-01-12 19:56 ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).