[libvirt] [PATCH] Fix memory leak

Stefan Berger stefanb at linux.vnet.ibm.com
Mon May 28 22:18:02 UTC 2012


Fix the following memory leak:

==3240== 23 bytes in 1 blocks are definitely lost in loss record 242 of 744
==3240==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==3240==    by 0x8077537: __vasprintf_chk (vasprintf_chk.c:82)
==3240==    by 0x509C677: virVasprintf (stdio2.h:199)
==3240==    by 0x509C733: virAsprintf (util.c:1912)
==3240==    by 0x1906583A: qemudStartup (qemu_driver.c:679)
==3240==    by 0x511991D: virStateInitialize (libvirt.c:809)
==3240==    by 0x40CD84: daemonRunStateInit (libvirtd.c:751)
==3240==    by 0x5098745: virThreadHelper (threads-pthread.c:161)
==3240==    by 0x7953D8F: start_thread (pthread_create.c:309)
==3240==    by 0x805FF5C: clone (clone.S:115)

---
  src/qemu/qemu_driver.c |    2 ++
  1 file changed, 2 insertions(+)

Index: libvirt-acl/src/qemu/qemu_driver.c
===================================================================
--- libvirt-acl.orig/src/qemu/qemu_driver.c
+++ libvirt-acl/src/qemu/qemu_driver.c
@@ -745,6 +745,8 @@ qemudStartup(int privileged) {
      if (conn)
          virConnectClose(conn);

+    VIR_FREE(membase);
+
      return 0;

  out_of_memory:




More information about the libvir-list mailing list