[PATCH 1/4] qemu: fix memory leak in opening log file

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

 



The qemuDomainLogContextNew method leaks the "logfile" path
on the non-virtlogd code path.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ed21245..4d6c595 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2360,13 +2360,15 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver,
         }
     }
 
+ cleanup:
     virObjectUnref(cfg);
+    VIR_FREE(logfile);
     return ctxt;
 
  error:
-    virObjectUnref(cfg);
     qemuDomainLogContextFree(ctxt);
-    return NULL;
+    ctxt = NULL;
+    goto cleanup;
 }
 
 
-- 
2.5.0

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