[libvirt] PATCH] Stop double free

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

 



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.

--
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]