debuggers.hg

changeset 22156:fc00d97c84a3

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>
author Gianni Tedesco <gianni.tedesco@citrix.com>
date Tue Sep 07 19:05:17 2010 +0100 (2010-09-07)
parents af3d0b44ebdc
children a936b806eae1
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Tue Sep 07 19:04:39 2010 +0100
     1.2 +++ b/tools/libxl/libxl.c	Tue Sep 07 19:05:17 2010 +0100
     1.3 @@ -67,7 +67,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int v
     1.4  
     1.5  int libxl_ctx_free(libxl_ctx *ctx)
     1.6  {
     1.7 -    xc_interface_close(ctx->xch);
     1.8 +    if (ctx->xch) xc_interface_close(ctx->xch);
     1.9      libxl_version_info_destroy(&ctx->version_info);
    1.10      if (ctx->xsh) xs_daemon_close(ctx->xsh); 
    1.11      return 0;