From patchwork Sat Jan 9 00:51:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 565112 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 01D2C1401CD for ; Sat, 9 Jan 2016 11:54:12 +1100 (AEDT) Received: from localhost ([::1]:38583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHhnF-00035Q-SM for incoming@patchwork.ozlabs.org; Fri, 08 Jan 2016 19:54:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHhlH-00077W-4z for qemu-devel@nongnu.org; Fri, 08 Jan 2016 19:52:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHhlG-0005kJ-B8 for qemu-devel@nongnu.org; Fri, 08 Jan 2016 19:52:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHhlG-0005kB-6M for qemu-devel@nongnu.org; Fri, 08 Jan 2016 19:52:06 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 9DCB7C076606; Sat, 9 Jan 2016 00:52:05 +0000 (UTC) Received: from scv.usersys.redhat.com (vpn-48-134.rdu2.redhat.com [10.10.48.134]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u090q0gN006320; Fri, 8 Jan 2016 19:52:04 -0500 From: John Snow To: qemu-devel@nongnu.org Date: Fri, 8 Jan 2016 19:51:50 -0500 Message-Id: <1452300718-10660-4-git-send-email-jsnow@redhat.com> In-Reply-To: <1452300718-10660-1-git-send-email-jsnow@redhat.com> References: <1452300718-10660-1-git-send-email-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, jsnow@redhat.com Subject: [Qemu-devel] [PULL 03/11] ahci-test: fix memory leak 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 Use the proper free command to detroy an AHCICommand. Signed-off-by: John Snow Message-id: 1452282920-21550-2-git-send-email-jsnow@redhat.com --- tests/ahci-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 0888506..f4945dc 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1045,14 +1045,14 @@ static void test_dma_fragmented(void) ahci_command_commit(ahci, cmd, px); ahci_command_issue(ahci, cmd); ahci_command_verify(ahci, cmd); - g_free(cmd); + ahci_command_free(cmd); cmd = ahci_command_create(CMD_READ_DMA); ahci_command_adjust(cmd, 0, ptr, bufsize, 32); ahci_command_commit(ahci, cmd, px); ahci_command_issue(ahci, cmd); ahci_command_verify(ahci, cmd); - g_free(cmd); + ahci_command_free(cmd); /* Read back the guest's receive buffer into local memory */ bufread(ptr, rx, bufsize);