From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 13/28] libxl: only free cputopology if it was allocated in libxl_{cpu, node}map_to_{node, cpu}map Date: Wed, 18 Sep 2013 15:37:49 +1200 Message-ID: <1379475484-25993-14-git-send-email-mattjd@gmail.com> References: <1379475484-25993-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1379475484-25993-1-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Matthew Daley , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Coverity-ID: 1055294 Coverity-ID: 1055295 Signed-off-by: Matthew Daley --- tools/libxl/libxl_utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c index 4309e5e..8e567a8 100644 --- a/tools/libxl/libxl_utils.c +++ b/tools/libxl/libxl_utils.c @@ -664,7 +664,8 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx, libxl_bitmap_set(cpumap, i); } out: - libxl_cputopology_list_free(tinfo, nr_cpus); + if (tinfo != NULL) + libxl_cputopology_list_free(tinfo, nr_cpus); return rc; } @@ -685,7 +686,8 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx, libxl_for_each_set_bit(i, *cpumap) libxl_bitmap_set(nodemap, tinfo[i].node); out: - libxl_cputopology_list_free(tinfo, nr_cpus); + if (tinfo != NULL) + libxl_cputopology_list_free(tinfo, nr_cpus); return rc; } -- 1.7.10.4