From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 12/28] libxl: only free cputopology if it was allocated in libxl__get_numa_candidate Date: Wed, 18 Sep 2013 15:37:48 +1200 Message-ID: <1379475484-25993-13-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: 1055293 Signed-off-by: Matthew Daley --- tools/libxl/libxl_numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c index 20c99ac..f9944e0 100644 --- a/tools/libxl/libxl_numa.c +++ b/tools/libxl/libxl_numa.c @@ -495,7 +495,8 @@ int libxl__get_numa_candidate(libxl__gc *gc, libxl_bitmap_dispose(&suitable_nodemap); libxl__numa_candidate_dispose(&new_cndt); libxl_numainfo_list_free(ninfo, nr_nodes); - libxl_cputopology_list_free(tinfo, nr_cpus); + if (tinfo != NULL) + libxl_cputopology_list_free(tinfo, nr_cpus); return rc; } -- 1.7.10.4