[vhostmd PATCH 13/18] vhostmd: Fix memory leak in parse_transports

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

 



>From coverity scan

vhostmd-1.1/vhostmd/vhostmd.c:455: alloc_fn: Storage is returned from allocation function "xmlXPathEval".
vhostmd-1.1/vhostmd/vhostmd.c:455: var_assign: Assigning: "obj" = storage returned from "xmlXPathEval((xmlChar *)"//vhostmd/globals/transport", ctxt)".
vhostmd-1.1/vhostmd/vhostmd.c:474: leaked_storage: Variable "obj" going out of scope leaks the storage it points to.
  472|   #else
  473|   	     vu_log (VHOSTMD_ERR, "No support for xenstore transport in this vhostmd");
  474|-> 	     return -1;
  475|   #endif
  476|   	 }

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 vhostmd/vhostmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vhostmd/vhostmd.c b/vhostmd/vhostmd.c
index 7374ec9..3d1d53e 100644
--- a/vhostmd/vhostmd.c
+++ b/vhostmd/vhostmd.c
@@ -472,6 +472,7 @@ static int parse_transports(xmlDocPtr xml,
              transports |= XENSTORE;
 #else
 	     vu_log (VHOSTMD_ERR, "No support for xenstore transport in this vhostmd");
+         xmlXPathFreeObject(obj);
 	     return -1;
 #endif
 	 }
-- 
2.16.4


_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux