server/server.zig — paneCwd allocates memory with opaque ownershipserver/server.zig — paneCwd allocates memory with opaque ownershipFile: src/server/server.zig:406–409
Severity: LOW
Status: ✅ FIXED — added doc comment noting caller must free.
pub fn paneCwd(self: *Server, pane: *Pane) ?[]const u8 {
const pty = pane.pty orelse return null;
return pty.getCwd(self.allocator) catch return null;
}
Returns an allocated slice but the return type ?[]const u8 gives no indication the caller must free it. Callers in executeAction do free it correctly via defer, but the API is fragile — any new caller that doesn’t know to free will leak.