[libvirt] PATCH] Stop double free

Mark Hamzy hamzy at us.ibm.com
Tue Sep 15 19:13:31 UTC 2009


This prevents a the following trap.

Program received signal SIGABRT, Aborted.
0x00000035ad830265 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00000035ad830265 in raise () from /lib64/libc.so.6
#1  0x00000035ad831d10 in abort () from /lib64/libc.so.6
#2  0x00000035ad86a84b in __libc_message () from /lib64/libc.so.6
#3  0x00000035ad8722ef in _int_free () from /lib64/libc.so.6.
#4  0x00000035ad87273b in free () from /lib64/libc.so.6.
#5  0x00000000004066f1 in vshDeinit ()
#6  0x0000000000406925 in vshError ())
#7  0x0000000000406744 in vshDeinit ()
#8  0x00000000004130be in main ()

---
 src/virsh.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/virsh.c b/src/virsh.c
index 4825f1c..5fc6c8f 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -8201,7 +8201,7 @@ vshError(vshControl *ctl, int doexit, const char
*format, ...)
     fputc('\n', stderr);

     if (doexit) {
-        if (ctl)
+        if (ctl && ctl->conn)
             vshDeinit(ctl);
         exit(EXIT_FAILURE);
     }
--
1.6.4.1

--
Mark

You must be the change you wish to see in the world. -- Mahatma Gandhi
Worrying is praying for that you do not wish to happen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090915/e23f9235/attachment-0001.htm>


More information about the libvir-list mailing list