From: Matthew Daley Date: Tue, 10 Sep 2013 10:18:46 +0000 (+1200) Subject: libxl: fix out-of-memory error handling in libxl_list_cpupool X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6183 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4c37ed562224295c0f8b00211287d57cae629782;p=xen.git libxl: fix out-of-memory error handling in libxl_list_cpupool ...otherwise it will return freed memory. All the current users of this function check already for a NULL return, so use that. Coverity-ID: 1056194 This is CVE-2013-4371 / XSA-70 Signed-off-by: Matthew Daley Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index b6daceaf9b..29e66f27d0 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -654,6 +654,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out) if (!tmp) { LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info"); libxl_cpupoolinfo_list_free(ptr, i); + ptr = NULL; goto out; } ptr = tmp;