mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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 <mattd@bugfuzz.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
ce021b0df5
commit
b1cb2bdde1
1 file changed
+2
@@ -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" */
|
||||
|
||||