From patchwork Thu May 28 12:08:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49075 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A99E218EC for ; Thu, 28 May 2015 12:18:31 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf10066062lbb.0 for ; Thu, 28 May 2015 05:18:30 -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=cC3OKT7jgFmakaOlWaG+rVMqotA6Mx6RvWRxYoa7UGk=; b=kpvIUkCSXqmpQmshVHYZTUeW39voxv9DNi45P9rQ11BKKv4+04cs3OlNFlSMsFzs+4 510svNEMCXUkwI5s9M63zlcCzw6y2Y/3MNLEXdTTQxWuP0GxmxwGW4VZM9KQRm20rqVF y6/nIRz/xXr5bbmanF7v+T+gJAxQVORMZS8Nf/Ujlqw+Bfa/nh2EOw3tK5NDYQL1rjJ+ d4IUMPXJtu2mHQq6m8nUuNWBWTeSA+JEcz7DwrLb0ytvt3vX07Eledl262vE8lRQbGzB AaBIZZ5bST5+NieN95WzvXO2N3PhHIVOQpzjsbYFxkTOKXPI/ZfBZUHv2rgY6aUanaIm 8vvg== X-Gm-Message-State: ALoCoQlvAtEd8BR0KxsHRodPoLJZqYyY4kRd3b0OlK7cBPpkji/QAYaJDaH56jMQpHmsfmlETinq X-Received: by 10.112.53.102 with SMTP id a6mr2465117lbp.16.1432815510398; Thu, 28 May 2015 05:18:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.164 with SMTP id cz4ls193950lac.3.gmail; Thu, 28 May 2015 05:18:30 -0700 (PDT) X-Received: by 10.152.20.99 with SMTP id m3mr2179552lae.20.1432815510273; Thu, 28 May 2015 05:18:30 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id h8si1816507lbc.56.2015.05.28.05.18.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so26822987lbb.3 for ; Thu, 28 May 2015 05:18:29 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr2470057lbc.73.1432815509860; Thu, 28 May 2015 05:18:29 -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 hn6csp1111065lbb; Thu, 28 May 2015 05:18:28 -0700 (PDT) X-Received: by 10.140.135.21 with SMTP id 21mr2818753qhh.89.1432815508530; Thu, 28 May 2015 05:18:28 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id j194si2176054qhc.48.2015.05.28.05.18.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:18:28 -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]:58366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxwlX-0006ml-MX for patch@linaro.org; Thu, 28 May 2015 08:18:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe9-0002HG-Um 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-0003cE-GA for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:49 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe3-0003Xt-RW; 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 COP98115; Thu, 28 May 2015 20:10:34 +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:12 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:42 +0800 Message-ID: <1432814932-12608-20-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 19/29] hw/openrisc/pic_cpu.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.172 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: ==2442== 256 bytes in 1 blocks are definitely lost in loss record 803 of 952 ==2442== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==2442== by 0x1E22A7: malloc_and_trace (vl.c:2556) ==2442== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==2442== by 0x22FF53: qemu_extend_irqs (irq.c:55) ==2442== by 0x22FFDF: qemu_allocate_irqs (irq.c:64) ==2442== by 0x1BCBBE: cpu_openrisc_pic_init (pic_cpu.c:55) ==2442== by 0x1BD3BA: openrisc_sim_init (openrisc_sim.c:121) ==2442== by 0x1E6672: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/openrisc/pic_cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/openrisc/pic_cpu.c b/hw/openrisc/pic_cpu.c index 2af1d60..8347f5c 100644 --- a/hw/openrisc/pic_cpu.c +++ b/hw/openrisc/pic_cpu.c @@ -57,4 +57,5 @@ void cpu_openrisc_pic_init(OpenRISCCPU *cpu) for (i = 0; i < NR_IRQS; i++) { cpu->env.irq[i] = qi[i]; } + g_free(qi); }