isl_ctx_free: properly free allocated options
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 5 Feb 2013 13:21:11 +0000 (14:21 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 5 Feb 2013 13:21:11 +0000 (14:21 +0100)
The original code would only free the outer structure, without
freeing any of the internally allocated memory.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ctx.c

index 515d865..6f02684 100644 (file)
--- a/isl_ctx.c
+++ b/isl_ctx.c
@@ -169,7 +169,7 @@ void isl_ctx_free(struct isl_ctx *ctx)
        isl_int_clear(ctx->normalize_gcd);
        isl_args_free(ctx->user_args, ctx->user_opt);
        if (ctx->opt_allocated)
-               free(ctx->opt);
+               isl_options_free(ctx->opt);
        free(ctx->stats);
        free(ctx);
 }