From 10905d3fd7e8c6846f791fa1c5dfa1580776e60c Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Sun, 1 Dec 2013 23:15:00 +1300 Subject: [PATCH] libxl: actually abort if initializing a ctx's lock fails If initializing the ctx's lock fails, don't keep going, but instead error out. Coverity-ID: 1055289 Signed-off-by: Matthew Daley Acked-by: Ian Jackson (cherry picked from commit b1cb2bdde1f2393d75a925e6c15862b93d3e7abd) (cherry picked from commit 62f88c08b31259032c81163f4133d6f25f033c1e) --- tools/libxl/libxl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index c47d21fd62..4f286442af 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -74,6 +74,8 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex"); free(ctx); ctx = 0; + rc = ERROR_FAIL; + goto out; } /* Now ctx is safe for ctx_free; failures simply set rc and "goto out" */ -- 2.39.5