From patchwork Thu May 28 12:08:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49074 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 355A9218EC for ; Thu, 28 May 2015 12:17:42 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf10106616lbb.1 for ; Thu, 28 May 2015 05:17:41 -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=pnhscD7g5X+Nrs7k97MwyPRuB/3QZ5KzUiKUSBkI/Pg=; b=ILkMp0DYx+LcegcNjyX6CcZ6zpixqieiO9gqjdfNHAeQsbIwGFevXlC1ljEMNuBuQb OzqxPpy8giBEiYOrMs+r5qUJJOiRlagWNUpeD8QwD8aP+Kt7aWu3azomvhChEW5tvvqE Q0mcsB3F/wDQYFqt3detzSZ/LQG/ATo+BzH5f2VIbXBq1BCA9htueYpu2UnxJiaK/T2V ihISewJcEcO1eNoSnZP2xUaQU+O/7WtuknGQiZgOeLD15i0ahQKBwvcr7TxrSqMoc4Mr OVo4+DqAFM4rBDDrPbLBvxAhL8O3an28Si0Yb8R0gDMdYUS/aEIh5ZZg3dMYcv3vZbjx VuRA== X-Gm-Message-State: ALoCoQm1h39nxur/VgLuLrL+cxp+l7GMQBFoIWqmfJlJgAHMNp2rfrb64HbfyBiAroBjaU5tLSjc X-Received: by 10.194.47.179 with SMTP id e19mr2457537wjn.4.1432815460976; Thu, 28 May 2015 05:17:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.99 with SMTP id lf3ls186337lac.54.gmail; Thu, 28 May 2015 05:17:40 -0700 (PDT) X-Received: by 10.112.158.103 with SMTP id wt7mr2465416lbb.5.1432815460849; Thu, 28 May 2015 05:17:40 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id pf2si1829017lbc.2.2015.05.28.05.17.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 05:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laat2 with SMTP id t2so30146363laa.1 for ; Thu, 28 May 2015 05:17:40 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr2439902lbb.112.1432815460588; Thu, 28 May 2015 05:17:40 -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 hn6csp1110417lbb; Thu, 28 May 2015 05:17:39 -0700 (PDT) X-Received: by 10.140.234.84 with SMTP id f81mr2876686qhc.49.1432815459355; Thu, 28 May 2015 05:17:39 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 22si2171616qht.56.2015.05.28.05.17.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 05:17:39 -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]:58358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwkk-0005II-B1 for patch@linaro.org; Thu, 28 May 2015 08:17:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe7-0002Fo-GS for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwe1-0003Ws-2M for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:47 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwdz-0003VU-Iz; Thu, 28 May 2015 08:10:41 -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 COP98092; Thu, 28 May 2015 20:10:29 +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:58 +0800 From: Shannon Zhao To: Date: Thu, 28 May 2015 20:08:30 +0800 Message-ID: <1432814932-12608-8-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 07/29] hw/timer/arm_timer.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.215.45 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: ==16356== 32 bytes in 2 blocks are definitely lost in loss record 1,689 of 2,802 ==16356== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16356== by 0x35478F: malloc_and_trace (vl.c:2556) ==16356== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==16356== by 0x3ED94B: qemu_extend_irqs (irq.c:55) ==16356== by 0x3ED9D7: qemu_allocate_irqs (irq.c:64) ==16356== by 0x4BA8D1: sp804_init (arm_timer.c:285) ==16356== by 0x3EEE1D: sysbus_device_init (sysbus.c:204) ==16356== by 0x3E838D: device_realize (qdev.c:247) ==16356== by 0x3EA48C: device_set_realized (qdev.c:1058) ==16356== by 0x516CD2: property_set_bool (object.c:1514) ==16356== by 0x5155CC: object_property_set (object.c:837) ==16356== by 0x5178EE: object_property_set_qobject (qom-qobject.c:24) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/timer/arm_timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 1452910..6894f76 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -288,6 +288,7 @@ static int sp804_init(SysBusDevice *sbd) s->timer[1] = arm_timer_init(s->freq1); s->timer[0]->irq = qi[0]; s->timer[1]->irq = qi[1]; + g_free(qi); memory_region_init_io(&s->iomem, OBJECT(s), &sp804_ops, s, "sp804", 0x1000); sysbus_init_mmio(sbd, &s->iomem);