[PATCH] qemu: Fix memory leak in qemuProcessWaitForMonitor

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

 



Move "VIR_FREE(buf) into label "closelog", so that "buf" could be
freed before returning.
---
 src/qemu/qemu_process.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b441137..7885d88 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1122,9 +1122,9 @@ cleanup:
         ret = -1;
     }
 
+closelog:
     VIR_FREE(buf);
 
-closelog:
     if (VIR_CLOSE(logfd) < 0) {
         char ebuf[1024];
         VIR_WARN("Unable to close logfile: %s",
-- 
1.7.4

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