diff options
| author | FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> | 2025-07-11 21:07:28 +0200 |
|---|---|---|
| committer | FourteenBrush <74827262+FourteenBrush@users.noreply.github.com> | 2025-07-11 21:07:28 +0200 |
| commit | 2dd0b7528926f9ea275bdbd9b6654a3e1600ac54 (patch) | |
| tree | db027ed95599504d3e2577265eaf54c0bef11aa2 /src | |
| parent | 64bb0d1c7d03d0ce3a1643401009c528ec9ac296 (diff) | |
Fix BigInt leaking
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_builtin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 041e89afd..4223419a5 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -6946,6 +6946,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As array_sort(enum_constants, enum_constant_entity_cmp); BigInt minus_one = big_int_make_i64(-1); + defer (big_int_dealloc(&minus_one)); BigInt diff = {}; bool contiguous = true; @@ -6956,6 +6957,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As BigInt curr = enum_constants[i]->Constant.value.value_integer; BigInt next = enum_constants[i + 1]->Constant.value.value_integer; big_int_sub(&diff, &curr, &next); + defer (big_int_dealloc(&diff)); if (!big_int_is_zero(&diff) && big_int_cmp(&diff, &minus_one) != 0) { contiguous = false; |