]> xenbits.xensource.com Git - 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)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 30 Jul 2012 13:38:07 +0000 (15:38 +0200)
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

index 3d120116ab7f5856584b705e52844a5cd63746f0..912aff6224b744d945ea805c11bc69a80d3d67ad 100644 (file)
@@ -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);