From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLQx2-0001BY-HZ for qemu-devel@nongnu.org; Fri, 08 Jul 2016 04:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLQwy-0003Cg-Cd for qemu-devel@nongnu.org; Fri, 08 Jul 2016 04:15:55 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:39676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLQwx-0003Aj-Nq for qemu-devel@nongnu.org; Fri, 08 Jul 2016 04:15:52 -0400 Message-ID: <577F610A.20008@huawei.com> Date: Fri, 8 Jul 2016 16:15:06 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <20160706164246.22116-1-marcandre.lureau@redhat.com> In-Reply-To: <20160706164246.22116-1-marcandre.lureau@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: pbonzini@redhat.com On 2016/7/7 0:42, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that > may leak some linked data. > > Signed-off-by: Marc-André Lureau I'm planing to send a patch, then I find this :) Reviewed-by: Shannon Zhao > --- > 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