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

[libvirt] [PATCH 2/2] conf: Remove callback from stream when freeing entries in console hash



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.
---
 src/conf/virconsole.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
index 3d12011..912aff6 100644
--- a/src/conf/virconsole.c
+++ b/src/conf/virconsole.c
@@ -219,6 +219,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.7.8.6


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