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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]