From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMrdr-0000R3-Kv for qemu-devel@nongnu.org; Thu, 28 Aug 2014 00:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMrdl-0001NL-GA for qemu-devel@nongnu.org; Thu, 28 Aug 2014 00:48:59 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:44639 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMrdl-0001NH-9v for qemu-devel@nongnu.org; Thu, 28 Aug 2014 00:48:53 -0400 Date: Thu, 28 Aug 2014 06:48:05 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140828044805.GB26019@irqsave.net> References: <1409199158-23453-1-git-send-email-famz@redhat.com> <1409199158-23453-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: <1409199158-23453-2-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 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 12:12:36 (+0800), Fam Zheng wrote : > Signed-off-by: Fam Zheng > --- > block/nfs.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/block/nfs.c b/block/nfs.c > index 93d87f3..8740c1a 100644 > --- a/block/nfs.c > +++ b/block/nfs.c > @@ -393,15 +393,19 @@ 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; > + ret =3D 0; > +out: > + qemu_opts_del(opts); > return 0; Hmm ... "return ret;" ? ;) > } > =20 > --=20 > 2.1.0 >=20