render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
c401cc
From 71865b5e2b71ba1f80685992f144005a87133a38 Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <71865b5e2b71ba1f80685992f144005a87133a38.1390394207.git.jdenemar@redhat.com>
c401cc
From: Michal Privoznik <mprivozn@redhat.com>
c401cc
Date: Thu, 16 Jan 2014 13:16:35 -0700
c401cc
Subject: [PATCH] virDomainEventCallbackListFree: Don't leak @list->callbacks
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1047964
c401cc
c401cc
The @list->callbacks is an array that is inflated whenever a new event
c401cc
is added, e.g. via virDomainEventCallbackListAddID(). However, when we
c401cc
are freeing the array, we free the items within it but forgot to
c401cc
actually free it.
c401cc
c401cc
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c401cc
(cherry picked from commit ea13a759f5b32204e1a7bdf6ee228235acb42bcb)
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/conf/domain_event.c | 1 +
c401cc
 1 file changed, 1 insertion(+)
c401cc
c401cc
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
c401cc
index 16ae92b..19e3920 100644
c401cc
--- a/src/conf/domain_event.c
c401cc
+++ b/src/conf/domain_event.c
c401cc
@@ -147,6 +147,7 @@ virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
c401cc
             (*freecb)(list->callbacks[i]->opaque);
c401cc
         VIR_FREE(list->callbacks[i]);
c401cc
     }
c401cc
+    VIR_FREE(list->callbacks);
c401cc
     VIR_FREE(list);
c401cc
 }
c401cc
 
c401cc
-- 
c401cc
1.8.5.3
c401cc