]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Remove callback from stream when freeing entries in console hash
authorPeter Krempa <pkrempa@redhat.com>
Fri, 27 Jul 2012 12:50:54 +0000 (14:50 +0200)
committerCole Robinson <crobinso@redhat.com>
Mon, 13 Aug 2012 01:15:46 +0000 (21:15 -0400)
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

index 443d80d44a840b2644c585078d16e03a789f2aba..e665149470c65147ae4c4182a4df90eb3cc7d94d 100644 (file)
@@ -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);