eval.c: Free the stack with FREE_LIST instead of FREE_OBJ

This way we pass the correct oldsize to the allocator.
This commit is contained in:
Laria 2022-02-09 20:44:21 +01:00
parent ebf3fc89ff
commit 78bd057c37

View file

@ -349,7 +349,7 @@ apfl_ctx_destroy(apfl_ctx ctx)
while (ctx->stack_len > 0) {
stack_must_drop(ctx, -1);
}
FREE_OBJ(ctx->allocator, ctx->stack);
FREE_LIST(ctx->allocator, ctx->stack, ctx->stack_cap);
FREE_OBJ(ctx->allocator, ctx);
}