From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxwe3-0002Ce-HP for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxwdz-0003Vy-CS for qemu-devel@nongnu.org; Thu, 28 May 2015 08:10:43 -0400 From: Shannon Zhao Date: Thu, 28 May 2015 20:08:24 +0800 Message-ID: <1432814932-12608-2-git-send-email-zhaoshenglong@huawei.com> 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 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 01/29] hw/ide/ahci.c: Fix memory leak spotted by valgrind List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org From: Shannon Zhao valgrind complains about: ==23381== 8 bytes in 1 blocks are definitely lost in loss record 438 of 2,785 ==23381== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==23381== by 0x35478F: malloc_and_trace (vl.c:2556) ==23381== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==23381== by 0x3ED98B: qemu_extend_irqs (irq.c:55) ==23381== by 0x3EDA17: qemu_allocate_irqs (irq.c:64) ==23381== by 0x43D767: ahci_init (ahci.c:1356) ==23381== by 0x43DAC5: sysbus_ahci_realize (ahci.c:1520) ==23381== by 0x3EA4CC: device_set_realized (qdev.c:1058) ==23381== by 0x516CD2: property_set_bool (object.c:1514) ==23381== by 0x5155CC: object_property_set (object.c:837) ==23381== by 0x5178EE: object_property_set_qobject (qom-qobject.c:24) ==23381== by 0x51583B: object_property_set_bool (object.c:905) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 9e5d862..4702a05 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1367,6 +1367,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports) ad->port.dma->ops = &ahci_dma_ops; ide_register_restart_cb(&ad->port); } + g_free(irqs); } void ahci_uninit(AHCIState *s) -- 2.0.4