M cmd/ssh/main.ha => cmd/ssh/main.ha +1 -0
@@ 5,6 5,7 @@ use os;
export fn main() void = {
const conn = dial::dial("tcp", os::args[1], "ssh")!;
+ defer io::close(conn);
const client = ssh::newclient(conn)!;
defer ssh::client_finish(&client);
M net/ssh/client.ha => net/ssh/client.ha +1 -2
@@ 33,10 33,9 @@ export fn newclient(conn: io::handle) (client | io::error) = {
};
};
-// Frees resources associated with this client. Closes the underlying
+// Frees resources associated with this client. Does not close the underlying
// connection.
export fn client_finish(client: *client) void = {
- io::close(client.conn)!;
free(client.rbuf);
};