From patchwork Thu May 28 12:08:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFE98218EC for ; Thu, 28 May 2015 12:32:34 +0000 (UTC) Received: by wgv5 with SMTP id 5sf5509192wgv.0 for ; Thu, 28 May 2015 05:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=BvZxZtxjpEYvAOSIInfcNeda0p0d9EiShlFCJhSAxMU=; b=DL8X0yFG3H8wmSmdIstS9K27Ohh9Oq/LPHiSQVGsf1xdzfNxz7WHRIvGHPGjc2sOE8 IGmj2Dur9H9fDBoNFfZgss9snJIkX1VtZ5r9v25a+ensb2dGa5bdBozGCjrCQvUPmfVE 9rAYU+LPh+T4UOt6I08laXExtaxXIHrAH25M8IqCXrtBlZK69RgsxrXWAg7/fWT11mz/ +j/4/KsYNIbZeD0FRGVpUlj/57yZu0K/YfDJSEIEC/GnoIQcKc0rBTYYt9CVJvPTxkD0 utFF5HRwTA42Nnz6RmxpR7WPqlvhmfYzH39q7vmYvzsq57XX8jl6rcQvSarnD/Fer8pJ SCBQ== X-Gm-Message-State: ALoCoQkfbD7TTCJ6qimipsHhXQxrfFZm52EUsR+Iab0bd/+kta6CzudUD33c7ksb0Hq45wqIv7do X-Received: by 10.180.106.136 with SMTP id gu8mr33066788wib.6.1432816353783; Thu, 28 May 2015 05:32:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.65 with SMTP id yg1ls164365lab.26.gmail; Thu, 28 May 2015 05:32:33 -0700 (PDT) X-Received: by 10.152.21.5 with SMTP id r5mr2540649lae.24.1432816353623; Thu, 28 May 2015 05:32:33 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id xl8si1846543lac.55.2015.05.28.05.32.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:32:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbuc2 with SMTP id uc2so27138691lbb.2 for ; Thu, 28 May 2015 05:32:33 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr2579718laa.106.1432816353389; Thu, 28 May 2015 05:32:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1121057lbb; Thu, 28 May 2015 05:32:32 -0700 (PDT) X-Received: by 10.55.33.6 with SMTP id h6mr4432737qkh.99.1432816352203; Thu, 28 May 2015 05:32:32 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 78si2210382qkp.59.2015.05.28.05.32.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:58546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwz9-0001D6-Bp for patch@linaro.org; Thu, 28 May 2015 08:32:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwhD-0007xd-5e for qemu-devel@nongnu.org; Thu, 28 May 2015 08:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwh9-0004le-Ce for qemu-devel@nongnu.org; Thu, 28 May 2015 08:13:59 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:39929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwh8-0004l8-P3; Thu, 28 May 2015 08:13:55 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BGR93436; Thu, 28 May 2015 20:10:21 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.158.1; Thu, 28 May 2015 20:09:55 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:27 +0800 Message-ID: <1432814932-12608-5-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432814932-12608-1-git-send-email-zhaoshenglong@huawei.com> References: <1432814932-12608-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.556705AD.0131, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a6934154f1c7d391e27cf5dc8c63741e X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 04/29] hw/i386/pc_q35.c: Fix memory leak spotted by valgrind 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao valgrind complains about: ==25058== 128 bytes in 1 blocks are definitely lost in loss record 2,624 of 3,473 ==25058== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==25058== by 0x2EB657: malloc_and_trace (vl.c:2556) ==25058== by 0x64C71F5: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3) ==25058== by 0x64C7766: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.3600.3) ==25058== by 0x3C62B2: i8259_init (i8259.c:475) ==25058== by 0x255AF4: pc_q35_init (pc_q35.c:232) ==25058== by 0x2EFA22: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/i386/pc_q35.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f2e3cf7..1a311dc 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -235,6 +235,7 @@ static void pc_q35_init(MachineState *machine) for (i = 0; i < ISA_NUM_IRQS; i++) { gsi_state->i8259_irq[i] = i8259[i]; } + g_free(i8259); if (pci_enabled) { ioapic_init_gsi(gsi_state, "q35"); }