[libvirt] [PATCH 0/5] avoid memory leaks

ajia at redhat.com ajia at redhat.com
Sun Sep 18 16:36:09 UTC 2011


Detected by Coverity.

* daemon/remote.c: Calling allocation function 'get_nonnull_domain' to 
  allocate memory to 'dom', but haven't released it in 'cleanup' section.
* src/qemu/qemu_command.c: Taking 'if (!port)' true branch then 'def = NULL',
  the codes jump into 'error' section, the function 'virDomainDefFree(def)'
  willn't release it.
* src/remote/remote_driver.c: Calling allocation function 'get_nonnull_domain' to
  allocate memory to 'dom', but haven't released it in 'no_memory' section.
* src/util/pci.c: Calling allocation function 'pciGetVirtualFunctions' on 
  'virt_fns', but haven't released it in 'out' section.
* src/vmx/vmx.c: Calling allocation function 'virConfReadMem' to allocate
  memory to 'conf' and then taking 'if (VIR_ALLOC(def) < 0)' true branch,
  the codes haven't released it before 'return NULL'.

Signed-off-by: Alex Jia <ajia at redhat.com>
---
 daemon/remote.c            |    2 ++
 src/qemu/qemu_command.c    |    1 -
 src/remote/remote_driver.c |    2 ++
 src/util/pci.c             |    1 +
 src/vmx/vmx.c              |    1 +
 5 files changed, 6 insertions(+), 1 deletions(-)




More information about the libvir-list mailing list