From patchwork Thu May 28 12:08:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49079 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80FC3218EC for ; Thu, 28 May 2015 12:19:38 +0000 (UTC) Received: by wizk4 with SMTP id k4sf13347331wiz.2 for ; Thu, 28 May 2015 05:19:37 -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=DiK8o5bE5OTi9nk5DTl8P3s802rx1lCO+/rEsOjhD0E=; b=lnJOBdpCM+nopaOAraUmyCYBI/Jz/Q1qkjmNqns5fTraaW0bR+OM1Jjd5X60uNtkmM vLby4PRdVaO680bCw5kWikvtnVPISiy59WE4RW33IMrIEtSiJecv/0TJvF5q73fho5Rc Fm6JAALCDRPt4ZtMCgvsx3J6XpFFf7HlUPmY6Y6/DOSYTLX68gS8snHDbprTPIXlM1De BizvnTnfeH1LZJ86d7Fd/5z/3j986XReh3QTMQz+DobDQWMq38vBisBPSXGFFW75gXwM +8vmmcJFZrYOJWlHu0MfQ5yx0ZMchzITDpSecimU/TkDmoKqPI64bpMUhJc224hBPZ2Q Y8hQ== X-Gm-Message-State: ALoCoQn8hj/Aafz1JivpPYgOR3+/H3u377UElcDuYhR+D4B177bUrDP3VXuNkm2oS7ZOzItQZayU X-Received: by 10.180.106.10 with SMTP id gq10mr33023003wib.0.1432815577842; Thu, 28 May 2015 05:19:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.9 with SMTP id ky9ls155051lab.98.gmail; Thu, 28 May 2015 05:19:37 -0700 (PDT) X-Received: by 10.112.161.197 with SMTP id xu5mr2441645lbb.69.1432815577693; Thu, 28 May 2015 05:19:37 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id x10si1796810lae.131.2015.05.28.05.19.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcue7 with SMTP id ue7so26923126lbc.0 for ; Thu, 28 May 2015 05:19:37 -0700 (PDT) X-Received: by 10.152.2.133 with SMTP id 5mr1122565lau.36.1432815577419; Thu, 28 May 2015 05:19:37 -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 hn6csp1111853lbb; Thu, 28 May 2015 05:19:36 -0700 (PDT) X-Received: by 10.55.31.27 with SMTP id f27mr4509394qkf.9.1432815576267; Thu, 28 May 2015 05:19:36 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id j60si2150865qgf.98.2015.05.28.05.19.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:58375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwmd-0000aK-BR for patch@linaro.org; Thu, 28 May 2015 08:19:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxweA-0002Hd-Td for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwe4-0003cS-JW for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:50 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe3-0003Xv-VC; Thu, 28 May 2015 08:10:44 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id COP98106; Thu, 28 May 2015 20:10:32 +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:10:06 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:37 +0800 Message-ID: <1432814932-12608-15-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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 58.251.152.64 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH 14/29] hw/mips/mips_int.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.176 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: ==24666== 64 bytes in 1 blocks are definitely lost in loss record 1,564 of 2,346 ==24666== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24666== by 0x2F5B8B: malloc_and_trace (vl.c:2556) ==24666== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==24666== by 0x3842F7: qemu_extend_irqs (irq.c:55) ==24666== by 0x384383: qemu_allocate_irqs (irq.c:64) ==24666== by 0x244186: cpu_mips_irq_init_cpu (mips_int.c:65) ==24666== by 0x244E88: mips_fulong2e_init (mips_fulong2e.c:345) ==24666== by 0x2F9F56: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/mips/mips_int.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c index d740046..56b43da 100644 --- a/hw/mips/mips_int.c +++ b/hw/mips/mips_int.c @@ -66,6 +66,7 @@ void cpu_mips_irq_init_cpu(CPUMIPSState *env) for (i = 0; i < 8; i++) { env->irq[i] = qi[i]; } + g_free(qi); } void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level)