From patchwork Wed Aug 27 06:02:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 383330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D7C271400B2 for ; Wed, 27 Aug 2014 16:04:31 +1000 (EST) Received: from localhost ([::1]:57668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMWLN-00068b-R1 for incoming@patchwork.ozlabs.org; Wed, 27 Aug 2014 02:04:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMWJc-00032I-E7 for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMWJW-0000R4-Ae for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:02:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMWJW-0000Qp-3b for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:02:34 -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 s7R62WMH020752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 27 Aug 2014 02:02:33 -0400 Received: from T430.nay.redhat.com (dhcp-14-155.nay.redhat.com [10.66.14.155]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7R62JBM022786; Wed, 27 Aug 2014 02:02:30 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 27 Aug 2014 14:02:35 +0800 Message-Id: <1409119356-22742-4-git-send-email-famz@redhat.com> In-Reply-To: <1409119356-22742-1-git-send-email-famz@redhat.com> References: <1409119356-22742-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 3/4] quorum: Fix leak of opts in quorum_open X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Fam Zheng Reviewed-by: BenoƮt Canet --- block/quorum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 0de07bb..ffe8bd9 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -796,7 +796,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags, { BDRVQuorumState *s = bs->opaque; Error *local_err = NULL; - QemuOpts *opts; + QemuOpts *opts = NULL; bool *opened; QDict *sub = NULL; QList *list = NULL; @@ -908,6 +908,7 @@ close_exit: g_free(s->bs); g_free(opened); exit: + qemu_opts_del(opts); /* propagate error */ if (local_err) { error_propagate(errp, local_err);