[PATCH 0/5] avoid memory leaks

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

 



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@xxxxxxxxxx>
---
 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(-)

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