From patchwork Fri Aug 29 16:30:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 384325 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 952CA14010B for ; Sat, 30 Aug 2014 02:46:45 +1000 (EST) Received: from localhost ([::1]:43184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNPJy-0001wM-QG for incoming@patchwork.ozlabs.org; Fri, 29 Aug 2014 12:46:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNP5E-0000SI-Sl for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:31:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNP58-00036N-KT for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:31:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNP58-00036B-Dk for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:31:22 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7TGVK2m028830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 29 Aug 2014 12:31:20 -0400 Received: from localhost (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7TGVJsx013774; Fri, 29 Aug 2014 12:31:19 -0400 From: Stefan Hajnoczi To: Date: Fri, 29 Aug 2014 17:30:03 +0100 Message-Id: <1409329803-20744-36-git-send-email-stefanha@redhat.com> In-Reply-To: <1409329803-20744-1-git-send-email-stefanha@redhat.com> References: <1409329803-20744-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id s7TGVK2m028830 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Fam Zheng , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 35/35] 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 From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: BenoƮt Canet Signed-off-by: Stefan Hajnoczi --- block/quorum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 0160fe3..093382e 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -868,7 +868,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; @@ -989,6 +989,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);