qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Alex Chen <alex.chen@huawei.com>, kraxel@redhat.com
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	zhang.zhanghailiang@huawei.com
Subject: Re: [PATCH] vnc: Fix a memleak in vnc_display_connect()
Date: Tue, 12 Jan 2021 20:56:22 +0100	[thread overview]
Message-ID: <647da265-f3a6-fef1-dcb3-43c7957ecd3e@vivier.eu> (raw)
In-Reply-To: <20201126065702.35095-1-alex.chen@huawei.com>

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



      parent reply	other threads:[~2021-01-12 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=647da265-f3a6-fef1-dcb3-43c7957ecd3e@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.chen@huawei.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).