From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMtRL-00028U-Fx for qemu-devel@nongnu.org; Thu, 28 Aug 2014 02:44:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMtRG-00081R-D8 for qemu-devel@nongnu.org; Thu, 28 Aug 2014 02:44:11 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:49605 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMtRG-00081N-69 for qemu-devel@nongnu.org; Thu, 28 Aug 2014 02:44:06 -0400 Date: Thu, 28 Aug 2014 08:43:17 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140828064317.GA28789@irqsave.net> References: <1409205372-15508-1-git-send-email-famz@redhat.com> <1409205372-15508-2-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409205372-15508-2-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 1/3] nfs: Fix leak of opts in nfs_file_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , benoit.canet@irqsave.net, qemu-devel@nongnu.org, Stefan Hajnoczi The Thursday 28 Aug 2014 =E0 13:56:10 (+0800), Fam Zheng wrote : > Signed-off-by: Fam Zheng > --- > block/nfs.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/block/nfs.c b/block/nfs.c > index 93d87f3..194f301 100644 > --- a/block/nfs.c > +++ b/block/nfs.c > @@ -393,16 +393,20 @@ static int nfs_file_open(BlockDriverState *bs, QD= ict *options, int flags, > qemu_opts_absorb_qdict(opts, options, &local_err); > if (local_err) { > error_propagate(errp, local_err); > - return -EINVAL; > + ret =3D -EINVAL; > + goto out; > } > ret =3D nfs_client_open(client, qemu_opt_get(opts, "filename"), > (flags & BDRV_O_RDWR) ? O_RDWR : O_RDONLY, > errp); > if (ret < 0) { > - return ret; > + goto out; > } > bs->total_sectors =3D ret; > - return 0; > + ret =3D 0; > +out: > + qemu_opts_del(opts); > + return ret; > } > =20 > static int nfs_file_create(const char *url, QemuOpts *opts, Error **er= rp) > --=20 > 2.1.0 >=20 >=20 Reviewed-by: Beno=EEt Canet