From patchwork Tue Mar 11 13:41:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 329108 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 B30252C00A1 for ; Wed, 12 Mar 2014 00:44:32 +1100 (EST) Received: from localhost ([::1]:55046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNMys-0004Eq-I2 for incoming@patchwork.ozlabs.org; Tue, 11 Mar 2014 09:44:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNMwH-0000Q4-5j for qemu-devel@nongnu.org; Tue, 11 Mar 2014 09:41:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNMwC-0006B8-6J for qemu-devel@nongnu.org; Tue, 11 Mar 2014 09:41:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNMwB-0006B2-Up for qemu-devel@nongnu.org; Tue, 11 Mar 2014 09:41:44 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2BDfaNs029211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Mar 2014 09:41:37 -0400 Received: from localhost (ovpn-113-134.phx2.redhat.com [10.3.113.134]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2BDfZSn014442; Tue, 11 Mar 2014 09:41:35 -0400 From: Luiz Capitulino To: peter.maydell@linaro.org Date: Tue, 11 Mar 2014 09:41:11 -0400 Message-Id: <1394545271-27573-12-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1394545271-27573-1-git-send-email-lcapitulino@redhat.com> References: <1394545271-27573-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws Subject: [Qemu-devel] [PULL 11/11] 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 Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- 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); }