From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIJiz-0003e6-5h for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIJit-00081w-4v for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:47:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIJis-00080S-SN for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:47:23 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7FFlK0I009201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Aug 2014 11:47:21 -0400 From: Max Reitz Date: Fri, 15 Aug 2014 17:47:04 +0200 Message-Id: <1408117628-17512-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1408117628-17512-1-git-send-email-mreitz@redhat.com> References: <1408117628-17512-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 3/7] qemu-img: Fix insignificant memleak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz As soon as options is set in img_amend(), it needs to be freed before the function returns. This leak is rather insignificant, as qemu-img will exit subsequently anyway, but there's no point in not fixing it. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoit Canet --- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 4b6406b..0bd8fa5 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2808,7 +2808,9 @@ static int img_amend(int argc, char **argv) } if (optind != argc - 1) { - error_exit("Expecting one image file name"); + error_report("Expecting one image file name"); + ret = -1; + goto out; } flags = BDRV_O_FLAGS | BDRV_O_RDWR; -- 2.0.3