From patchwork Tue Dec 7 09:35:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 74497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 44C7CB70B0 for ; Tue, 7 Dec 2010 20:38:00 +1100 (EST) Received: from localhost ([127.0.0.1]:48959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPtzh-0006CH-6p for incoming@patchwork.ozlabs.org; Tue, 07 Dec 2010 04:37:57 -0500 Received: from [140.186.70.92] (port=51195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPtxq-0006B1-SR for qemu-devel@nongnu.org; Tue, 07 Dec 2010 04:36:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPtxp-0001QL-Oo for qemu-devel@nongnu.org; Tue, 07 Dec 2010 04:36:02 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:40932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPtxp-0001Pm-Dd for qemu-devel@nongnu.org; Tue, 07 Dec 2010 04:36:01 -0500 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oB79Zxf6005208 for ; Tue, 7 Dec 2010 09:35:59 GMT Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB79a0eV3280928 for ; Tue, 7 Dec 2010 09:36:00 GMT Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB79Zw5i013004 for ; Tue, 7 Dec 2010 02:35:59 -0700 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-22.manchester-maybrook.uk.ibm.com [9.174.219.22]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oB79ZwVV012971; Tue, 7 Dec 2010 02:35:58 -0700 From: Stefan Hajnoczi To: Date: Tue, 7 Dec 2010 09:35:55 +0000 Message-Id: <1291714556-22961-4-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1291714556-22961-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1291714556-22961-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Kevin Wolf , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 3/4] qemu-img: Free option parameter lists in img_create() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Free option parameter lists in the img_create() error return path. Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 5b6e648..23bb7dc 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -439,8 +439,6 @@ static int img_create(int argc, char **argv) puts(""); ret = bdrv_create(drv, filename, param); - free_option_parameters(create_options); - free_option_parameters(param); if (ret < 0) { if (ret == -ENOTSUP) { @@ -452,6 +450,8 @@ static int img_create(int argc, char **argv) } } out: + free_option_parameters(create_options); + free_option_parameters(param); if (ret) { return 1; }