mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: Fix NULL deref in libxl_ctx_free()
xc_interface_close() will de-reference a NULL handle, check for this condition in libxl_ctx_free() before calling. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
a1c6702f19
commit
ec7b9a1b9b
1 file changed
+1
-1
+1
-1
@@ -67,7 +67,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger *lg)
|
||||
|
||||
int libxl_ctx_free(libxl_ctx *ctx)
|
||||
{
|
||||
xc_interface_close(ctx->xch);
|
||||
if (ctx->xch) xc_interface_close(ctx->xch);
|
||||
libxl_version_info_destroy(&ctx->version_info);
|
||||
if (ctx->xsh) xs_daemon_close(ctx->xsh);
|
||||
return 0;
|
||||
|
||||