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

[Xen-devel] [PATCH 5/9] libxl: avoid leaking string in cpupool_info



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 38aff8d..4151dcb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -740,8 +740,10 @@ static int cpupool_info(libxl__gc *gc,
     info->sched = xcinfo->sched_id;
     info->n_dom = xcinfo->n_dom;
     rc = libxl_cpu_bitmap_alloc(CTX, &info->cpumap, 0);
-    if (rc)
+    if (rc) {
+        free(info->pool_name);
         goto out;
+    }
 
     memcpy(info->cpumap.map, xcinfo->cpumap, info->cpumap.size);
 
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.