]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainEventCallbackListFree: Don't leak @list->callbacks
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2013 09:33:30 +0000 (10:33 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2013 16:44:20 +0000 (17:44 +0100)
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@redhat.com>
src/conf/domain_event.c

index 16ae92b49f10e608572df1813ead63e887e296a0..19e392000e7fe1d50a1eff8daf90a8cceb644a59 100644 (file)
@@ -147,6 +147,7 @@ virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
             (*freecb)(list->callbacks[i]->opaque);
         VIR_FREE(list->callbacks[i]);
     }
+    VIR_FREE(list->callbacks);
     VIR_FREE(list);
 }