render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 71865b5e2b71ba1f80685992f144005a87133a38 Mon Sep 17 00:00:00 2001
Message-Id: <71865b5e2b71ba1f80685992f144005a87133a38.1390394207.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 16 Jan 2014 13:16:35 -0700
Subject: [PATCH] virDomainEventCallbackListFree: Don't leak @list->callbacks

https://bugzilla.redhat.com/show_bug.cgi?id=1047964

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>
(cherry picked from commit ea13a759f5b32204e1a7bdf6ee228235acb42bcb)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 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.5.3