qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup
Date: Fri, 8 Jul 2016 16:15:06 +0800	[thread overview]
Message-ID: <577F610A.20008@huawei.com> (raw)
In-Reply-To: <20160706164246.22116-1-marcandre.lureau@redhat.com>



On 2016/7/7 0:42, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
> may leak some linked data.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
I'm planing to send a patch, then I find this :)

Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>

> ---
>  util/qemu-sockets.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index fb83d48..777af49 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
>          }
>      }
>  
> -    g_free(addr);
> +    qapi_free_SocketAddress(addr);
>  }
>  
>  int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
> 

-- 
Shannon

  parent reply	other threads:[~2016-07-08  8:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 16:42 [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup marcandre.lureau
2016-07-06 20:18 ` Eric Blake
2016-07-08  8:15 ` Shannon Zhao [this message]
2016-07-08 14:03 ` Paolo Bonzini

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=577F610A.20008@huawei.com \
    --to=zhaoshenglong@huawei.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).