diff --git a/src/nightwatch.zig b/src/nightwatch.zig index 47aa5b9..1c64b6e 100644 --- a/src/nightwatch.zig +++ b/src/nightwatch.zig @@ -494,7 +494,7 @@ const KQueueBackend = struct { self.watches.deinit(allocator); var sit = self.snapshots.iterator(); while (sit.next()) |entry| { - allocator.free(entry.key_ptr.*); + // Keys are borrowed from self.watches and freed in the watches loop above. var names = entry.value_ptr.*; var nit = names.iterator(); while (nit.next()) |ne| allocator.free(ne.key_ptr.*); diff --git a/src/nightwatch_test.zig b/src/nightwatch_test.zig index e492f69..aa5c22e 100644 --- a/src/nightwatch_test.zig +++ b/src/nightwatch_test.zig @@ -148,7 +148,7 @@ fn makeTempDir(allocator: std.mem.Allocator) ![]u8 { const name = try std.fmt.allocPrint( allocator, "/tmp/nightwatch_test_{d}_{d}", - .{ std.os.linux.getpid(), n }, + .{ std.c.getpid(), n }, ); errdefer allocator.free(name); try std.fs.makeDirAbsolute(name);