diff options
Diffstat (limited to 'src/FoldData.zig')
| -rw-r--r-- | src/FoldData.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/FoldData.zig b/src/FoldData.zig index d425178..a3d47af 100644 --- a/src/FoldData.zig +++ b/src/FoldData.zig | |||
| @@ -47,6 +47,7 @@ pub fn init(allocator: mem.Allocator) !Self { | |||
| 47 | self.cwcf_exceptions_max = @intCast(try reader.readInt(u24, endian)); | 47 | self.cwcf_exceptions_max = @intCast(try reader.readInt(u24, endian)); |
| 48 | len = try reader.readInt(u16, endian); | 48 | len = try reader.readInt(u16, endian); |
| 49 | self.cwcf_exceptions = try allocator.alloc(u21, len); | 49 | self.cwcf_exceptions = try allocator.alloc(u21, len); |
| 50 | errdefer allocator.free(self.cwcf_exceptions); | ||
| 50 | for (0..len) |i| self.cwcf_exceptions[i] = @intCast(try reader.readInt(u24, endian)); | 51 | for (0..len) |i| self.cwcf_exceptions[i] = @intCast(try reader.readInt(u24, endian)); |
| 51 | 52 | ||
| 52 | return self; | 53 | return self; |
| @@ -56,6 +57,7 @@ pub fn deinit(self: *const Self) void { | |||
| 56 | self.allocator.free(self.stage1); | 57 | self.allocator.free(self.stage1); |
| 57 | self.allocator.free(self.stage2); | 58 | self.allocator.free(self.stage2); |
| 58 | self.allocator.free(self.stage3); | 59 | self.allocator.free(self.stage3); |
| 60 | self.allocator.free(self.cwcf_exceptions); | ||
| 59 | } | 61 | } |
| 60 | 62 | ||
| 61 | /// Returns the case fold for `cp`. | 63 | /// Returns the case fold for `cp`. |