[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/3] virDomainVirtioSerialAddrSetFree: Fix memleak



==19015== 8 bytes in 1 blocks are definitely lost in loss record 34 of 1,049
==19015==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19015==    by 0x4C2C32F: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19015==    by 0x52AD888: virReallocN (viralloc.c:245)
==19015==    by 0x52AD97E: virExpandN (viralloc.c:294)
==19015==    by 0x52ADC51: virInsertElementsN (viralloc.c:436)
==19015==    by 0x5335864: virDomainVirtioSerialAddrSetAddController (domain_addr.c:816)
==19015==    by 0x53358E0: virDomainVirtioSerialAddrSetAddControllers (domain_addr.c:839)
==19015==    by 0x1DD5513B: qemuDomainAssignVirtioSerialAddresses (qemu_command.c:1422)
==19015==    by 0x1DD55A6E: qemuDomainAssignAddresses (qemu_command.c:1711)
==19015==    by 0x1DDA5818: qemuProcessStart (qemu_process.c:4616)
==19015==    by 0x1DDF1807: qemuDomainObjStart (qemu_driver.c:7265)
==19015==    by 0x1DDF1A66: qemuDomainCreateWithFlags (qemu_driver.c:7320)

Signed-off-by: Michal Privoznik <mprivozn redhat com>
---
 src/conf/domain_addr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 27a237d..d657c7f 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -873,6 +873,7 @@ virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs)
     if (addrs) {
         for (i = 0; i < addrs->ncontrollers; i++)
             virDomainVirtioSerialControllerFree(addrs->controllers[i]);
+        VIR_FREE(addrs->controllers);
         VIR_FREE(addrs);
     }
 }
-- 
2.0.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]