From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXpj8-00046w-TT for qemu-devel@nongnu.org; Wed, 09 Apr 2014 06:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXpj1-0003G5-UV for qemu-devel@nongnu.org; Wed, 09 Apr 2014 06:27:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXpj1-0003Fk-NJ for qemu-devel@nongnu.org; Wed, 09 Apr 2014 06:27:23 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s39ARL5P001326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Apr 2014 06:27:21 -0400 Message-ID: <53452087.7040104@redhat.com> Date: Wed, 09 Apr 2014 12:27:19 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1397035209-14086-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1397035209-14086-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] bochs: Fix memory leak in bochs_open() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com On 04/09/14 11:20, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/bochs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/block/bochs.c b/block/bochs.c > index 826ec12..50b84a9 100644 > --- a/block/bochs.c > +++ b/block/bochs.c > @@ -150,11 +150,13 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, > s->extent_size = le32_to_cpu(bochs.extent); > if (s->extent_size == 0) { > error_setg(errp, "Extent size may not be zero"); > - return -EINVAL; > + ret = -EINVAL; > + goto fail; > } else if (s->extent_size > 0x800000) { > error_setg(errp, "Extent size %" PRIu32 " is too large", > s->extent_size); > - return -EINVAL; > + ret = -EINVAL; > + goto fail; > } > > if (s->catalog_size < bs->total_sectors / s->extent_size) { > Reviewed-by: Laszlo Ersek