| ... | @@ -6,6 +6,9 @@ const Allocator = std.mem.Allocator; | ... | @@ -6,6 +6,9 @@ const Allocator = std.mem.Allocator; |
| 6 | const Bundle = @import("../Bundle.zig"); | 6 | const Bundle = @import("../Bundle.zig"); |
| 7 | | 7 | |
| 8 | pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void { | 8 | pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void { |
| | 9 | cb.bytes.clearRetainingCapacity(); |
| | 10 | cb.map.clearRetainingCapacity(); |
| | 11 | |
| 9 | const file = try fs.openFileAbsolute("/System/Library/Keychains/SystemRootCertificates.keychain", .{}); | 12 | const file = try fs.openFileAbsolute("/System/Library/Keychains/SystemRootCertificates.keychain", .{}); |
| 10 | defer file.close(); | 13 | defer file.close(); |
| 11 | | 14 | |
| ... | @@ -63,6 +66,8 @@ pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void { | ... | @@ -63,6 +66,8 @@ pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void { |
| 63 | try cb.parseCert(gpa, cert_start, now_sec); | 66 | try cb.parseCert(gpa, cert_start, now_sec); |
| 64 | } | 67 | } |
| 65 | } | 68 | } |
| | 69 | |
| | 70 | cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len); |
| 66 | } | 71 | } |
| 67 | | 72 | |
| 68 | const ApplDbHeader = extern struct { | 73 | const ApplDbHeader = extern struct { |