From patchwork Sat Mar 8 17:27:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 328218 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 CF1252C00AA for ; Sun, 9 Mar 2014 04:27:38 +1100 (EST) Received: from localhost ([::1]:41336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WML26-00022I-MN for incoming@patchwork.ozlabs.org; Sat, 08 Mar 2014 12:27:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WML1o-000222-CN for qemu-devel@nongnu.org; Sat, 08 Mar 2014 12:27:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WML1j-00015L-H0 for qemu-devel@nongnu.org; Sat, 08 Mar 2014 12:27:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WML1j-00015E-90 for qemu-devel@nongnu.org; Sat, 08 Mar 2014 12:27:11 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s28HR9rL014798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Mar 2014 12:27:09 -0500 Received: from localhost (ovpn-113-38.phx2.redhat.com [10.3.113.38]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s28HR7ep010178; Sat, 8 Mar 2014 12:27:07 -0500 Date: Sat, 8 Mar 2014 12:27:06 -0500 From: Luiz Capitulino To: Peter Maydell Message-ID: <20140308122706.58858d92@redhat.com> In-Reply-To: References: <20140308110933.28374e9a@redhat.com> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: QEMU Developers , Markus Armbruster Subject: [Qemu-devel] [PATCH] tests: test-qmp-commands: Fix double free 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 The ret variable is freed twice, but on the second time we actually want to free ret3 instead. Don't know why this didn't explode. Reported-by: Peter Maydell Tested-by: Peter Maydell Signed-off-by: Luiz Capitulino Reviewed-by: Eric Blake --- tests/test-qmp-commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index 8e62c2d..554e222 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -141,7 +141,7 @@ static void test_dispatch_cmd_io(void) ret3 = qobject_to_qint(test_qmp_dispatch(req)); assert(qint_get_int(ret3) == 66); - QDECREF(ret); + QDECREF(ret3); QDECREF(req); }