From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XClHh-00014g-7M for qemu-devel@nongnu.org; Thu, 31 Jul 2014 04:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XClHc-0000gC-3x for qemu-devel@nongnu.org; Thu, 31 Jul 2014 04:00:21 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56493 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XClHb-0000fw-Ua for qemu-devel@nongnu.org; Thu, 31 Jul 2014 04:00:16 -0400 Date: Thu, 31 Jul 2014 09:59:30 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140731075929.GG707@irqsave.net> References: <1406402531-9278-1-git-send-email-mreitz@redhat.com> <1406402531-9278-4-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1406402531-9278-4-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH alt 3/7] qemu-img: Fix insignifcant memleak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Saturday 26 Jul 2014 =E0 21:22:07 (+0200), Max Reitz wrote : > As soon as options is set in img_amend(), it needs to be freed before > the function returns. This leak is rather insignifcant, as qemu-img wil= l > exit subsequently anyway, but there's no point in not fixing it. >=20 > Signed-off-by: Max Reitz > --- > qemu-img.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index a06f425..d73a68a 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -2809,7 +2809,9 @@ static int img_amend(int argc, char **argv) > } > =20 > if (optind !=3D argc - 1) { > - error_exit("Expecting one image file name"); > + error_report("Expecting one image file name"); > + ret =3D -1; > + goto out; > } > =20 > flags =3D BDRV_O_FLAGS | BDRV_O_RDWR; > --=20 > 2.0.3 >=20 >=20 Reviewed-by: Benoit Canet