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

[libvirt] [v0.9.12-maint v3 09/12] conf: Remove callback from stream when freeing entries in console hash



From: Peter Krempa <pkrempa redhat com>

When a domain has a active console connection and is destroyed the
callback is called on private data that no longer exist causing a
segfault.

(cherry picked from commit ba226d334acbc49f6751b430e0c4e00f69eef6bf)
---
 src/conf/virconsole.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
index 443d80d..e665149 100644
--- a/src/conf/virconsole.c
+++ b/src/conf/virconsole.c
@@ -222,6 +222,9 @@ static void virConsoleHashEntryFree(void *data,
     const char *pty = name;
     virStreamPtr st = data;
 
+    /* remove callback from stream */
+    virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
+
     /* free stream reference */
     virStreamFree(st);
 
-- 
1.8.4.rc3


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