[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: change semantics of ctx_free and remove ctx_close
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1262176844 0 # Node ID 042f50e7353f741bf3a22adb2616f83a6bd7651f # Parent 3f654b88e201a1341786a0e8725c25f40c1162b7 libxl: change semantics of ctx_free and remove ctx_close ctx_close isn't use anywhere, and free reallocate the GC array, which is quite surprising and lead to memory leaking in xl.c Signed-off-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx> --- tools/libxl/libxl.c | 10 ---------- tools/libxl/libxl.h | 1 - 2 files changed, 11 deletions(-) diff -r 3f654b88e201 -r 042f50e7353f tools/libxl/libxl.c --- a/tools/libxl/libxl.c Tue Dec 29 15:11:47 2009 +0000 +++ b/tools/libxl/libxl.c Wed Dec 30 12:40:44 2009 +0000 @@ -52,16 +52,6 @@ int libxl_ctx_free(struct libxl_ctx *ctx int libxl_ctx_free(struct libxl_ctx *ctx) { libxl_free_all(ctx); - free(ctx->alloc_ptrs); - ctx->alloc_ptrs = calloc(ctx->alloc_maxsize, sizeof(void *)); - if (!ctx->alloc_ptrs) - return ERROR_NOMEM; - return 0; -} - -int libxl_ctx_close(struct libxl_ctx *ctx) -{ - libxl_ctx_free(ctx); free(ctx->alloc_ptrs); xc_interface_close(ctx->xch); xs_daemon_close(ctx->xsh); diff -r 3f654b88e201 -r 042f50e7353f tools/libxl/libxl.h --- a/tools/libxl/libxl.h Tue Dec 29 15:11:47 2009 +0000 +++ b/tools/libxl/libxl.h Wed Dec 30 12:40:44 2009 +0000 @@ -253,7 +253,6 @@ void xl_log(struct libxl_ctx *ctx, int e /* context functions */ int libxl_ctx_init(struct libxl_ctx *ctx); int libxl_ctx_free(struct libxl_ctx *ctx); -int libxl_ctx_close(struct libxl_ctx *ctx); int libxl_ctx_set_log(struct libxl_ctx *ctx, libxl_log_callback log_callback, void *log_data); /* domain related functions */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |