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

[Xen-devel] [PATCH 10/28] libxl: only free cpupoolinfo if necessary in libxl_list_cpupool



Coverity-ID: 1055291
Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>
---
 tools/libxl/libxl.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ca24ca3..eeaaee8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -650,7 +650,8 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int 
*nb_pool_out)
         tmp = realloc(ptr, (i + 1) * sizeof(libxl_cpupoolinfo));
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
-            libxl_cpupoolinfo_list_free(ptr, i);
+            if (ptr)
+                libxl_cpupoolinfo_list_free(ptr, i);
             goto out;
         }
         ptr = tmp;
-- 
1.7.10.4


_______________________________________________
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®.