[PATCH 5/6] virDomainEventCallbackListFree: Don't leak @list->callbacks

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

 



The @list->callbacks is an array that is inflated whenever a new event
is added, e.g. via virDomainEventCallbackListAddID(). However, when we
are freeing the array, we free the items within it but forgot to
actually free it.

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

diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 16ae92b..19e3920 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -147,6 +147,7 @@ virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
             (*freecb)(list->callbacks[i]->opaque);
         VIR_FREE(list->callbacks[i]);
     }
+    VIR_FREE(list->callbacks);
     VIR_FREE(list);
 }
 
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]