From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buJis-0006cc-Ly for qemu-devel@nongnu.org; Wed, 12 Oct 2016 09:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buJin-0003yr-M5 for qemu-devel@nongnu.org; Wed, 12 Oct 2016 09:37:29 -0400 Received: from 6.mo179.mail-out.ovh.net ([46.105.56.76]:51879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buJin-0003yb-H3 for qemu-devel@nongnu.org; Wed, 12 Oct 2016 09:37:25 -0400 Received: from player792.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id BBD64FFC8B9 for ; Wed, 12 Oct 2016 15:37:24 +0200 (CEST) Date: Wed, 12 Oct 2016 15:37:21 +0200 From: Greg Kurz Message-ID: <20161012153721.57603553@bahia> In-Reply-To: <57fde276.652f6b0a.4ba6d.b725@mx.google.com> References: <57fde276.652f6b0a.4ba6d.b725@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] 9pfs: fix memory leak in v9fs_link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Qiang Cc: qemu-devel@nongnu.org, Li Qiang On Wed, 12 Oct 2016 00:12:48 -0700 Li Qiang wrote: > From: Li Qiang > > In v9fs_link dispatch function, it doesn't put the 'oldfidp' > fid object, this will make the 'oldfidp->ref' never reach to 0, > thus leading a memory leak issue. This patch fix this. > > Signed-off-by: Li Qiang > --- Good catch! Reviewed-by: Greg Kurz > hw/9pfs/9p.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c > index 8b50bfb..29f8b7a 100644 > --- a/hw/9pfs/9p.c > +++ b/hw/9pfs/9p.c > @@ -2413,6 +2413,7 @@ static void v9fs_link(void *opaque) > if (!err) { > err = offset; > } > + put_fid(pdu, oldfidp); > out: > put_fid(pdu, dfidp); > out_nofid: