From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XB7Xp-0001j1-NZ for qemu-devel@nongnu.org; Sat, 26 Jul 2014 15:22:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XB7Xj-0005aI-Fg for qemu-devel@nongnu.org; Sat, 26 Jul 2014 15:22:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XB7Xj-0005aE-8w for qemu-devel@nongnu.org; Sat, 26 Jul 2014 15:22:07 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6QJM6D5005981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 26 Jul 2014 15:22:06 -0400 From: Max Reitz Date: Sat, 26 Jul 2014 21:22:07 +0200 Message-Id: <1406402531-9278-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1406402531-9278-1-git-send-email-mreitz@redhat.com> References: <1406402531-9278-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH alt 3/7] qemu-img: Fix insignifcant 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 insignifcant, as qemu-img will exit subsequently anyway, but there's no point in not fixing it. Signed-off-by: Max Reitz --- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) } 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