Skip to content

Commit 8235dc3

Browse files
committed
upstream: fix some one-off leaks in ssh.c; ok dtucker@
OpenBSD-Commit-ID: bf3c27ffe4b3cccb6553b554ec4c04929065a2bc
1 parent 846987d commit 8235dc3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

ssh.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ssh.c,v 1.618 2025/09/15 04:50:42 djm Exp $ */
1+
/* $OpenBSD: ssh.c,v 1.619 2025/09/25 07:05:11 djm Exp $ */
22
/*
33
* Author: Tatu Ylonen <ylo@cs.hut.fi>
44
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1725,8 +1725,6 @@ main(int ac, char **av)
17251725
&timeout_ms, options.tcp_keep_alive) != 0)
17261726
exit(255);
17271727

1728-
if (addrs != NULL)
1729-
freeaddrinfo(addrs);
17301728

17311729
ssh_packet_set_timeout(ssh, options.server_alive_interval,
17321730
options.server_alive_count_max);
@@ -1867,9 +1865,13 @@ main(int ac, char **av)
18671865
#endif
18681866

18691867
skip_connect:
1868+
if (addrs != NULL)
1869+
freeaddrinfo(addrs);
18701870
exit_status = ssh_session2(ssh, cinfo);
18711871
ssh_conn_info_free(cinfo);
1872-
ssh_packet_close(ssh);
1872+
channel_free_channels(ssh);
1873+
ssh_packet_free(ssh);
1874+
pwfree(pw);
18731875

18741876
if (options.control_path != NULL && muxserver_sock != -1)
18751877
unlink(options.control_path);

0 commit comments

Comments
 (0)