* [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
* Re: [PATCH] vnc: Fix a memleak in vnc_display_connect()
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
2 siblings, 0 replies; 4+ messages in thread
From: Li Qiang @ 2020-11-26 10:32 UTC (permalink / raw)
To: Alex Chen; +Cc: qemu-trivial, zhanghailiang, Gerd Hoffmann, Qemu Developers
Alex Chen <alex.chen@huawei.com> 于2020年11月26日周四 下午3:10写道:
>
> 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>
> ---
> 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 [flat|nested] 4+ messages in thread
* Re: [PATCH] vnc: Fix a memleak in vnc_display_connect()
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
2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-01-12 19:49 UTC (permalink / raw)
To: Alex Chen, kraxel; +Cc: qemu-trivial, qemu-devel, zhang.zhanghailiang
Le 26/11/2020 à 07:57, Alex Chen a écrit :
> 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);
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vnc: Fix a memleak in vnc_display_connect()
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
2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-01-12 19:56 UTC (permalink / raw)
To: Alex Chen, kraxel; +Cc: qemu-trivial, qemu-devel, zhang.zhanghailiang
Le 26/11/2020 à 07:57, Alex Chen a écrit :
> 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);
>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [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).