From patchwork Wed Mar 16 10:16:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 8597331 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6338DC0553 for ; Wed, 16 Mar 2016 10:17:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D622820225 for ; Wed, 16 Mar 2016 10:17:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 187F6201CE for ; Wed, 16 Mar 2016 10:17:23 +0000 (UTC) Received: from localhost ([::1]:54342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8W2-0005uB-Cy for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 06:17:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8Vr-0005of-Rm for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:17:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag8Vo-000899-09 for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:17:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8Vi-00087L-1J; Wed, 16 Mar 2016 06:17:02 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id E7A4264381; Wed, 16 Mar 2016 10:17:00 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2GAGx1E014728; Wed, 16 Mar 2016 06:16:59 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 16 Mar 2016 11:16:57 +0100 Message-Id: <1458123417-7735-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 16 Mar 2016 10:17:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] block: Fix memory leak in hmp_drive_add_node() 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP hmp_drive_add_node() leaked qdict in the error path when no node-name is specified. Signed-off-by: Kevin Wolf Reviewed-by: Markus Armbruster --- blockdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blockdev.c b/blockdev.c index e7b8676..50410bf 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr) qdict = qemu_opts_to_qdict(opts, NULL); if (!qdict_get_try_str(qdict, "node-name")) { + QDECREF(qdict); error_report("'node-name' needs to be specified"); goto out; }