Skip to content

Commit bda355d

Browse files
authored
Merge pull request #3992 from ForLoveOfCats/BigIntToStringLeak
Add missing deferred deinits to `math.big.Int.toString`
2 parents cb02125 + b28824e commit bda355d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/std/math/big/int.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,12 @@ pub const Int = struct {
477477
}
478478

479479
var q = try self.clone();
480+
defer q.deinit();
480481
q.abs();
481482
var r = try Int.init(allocator);
483+
defer r.deinit();
482484
var b = try Int.initSet(allocator, limb_base);
485+
defer b.deinit();
483486

484487
while (q.len() >= 2) {
485488
try Int.divTrunc(&q, &r, q, b);

0 commit comments

Comments
 (0)