summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2020-07-01 16:28:32 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2020-07-01 16:28:32 +0000
commit02306e50ded439b2560da2160239bc9f7e2785fa (patch)
tree13b77dd8bd166c357ca92b1cac7527ebec4b0e61 /usr.bin/ssh
parent6ba2cae555409e1927b1ce2b539cd46b1899fd00 (diff)
free kex in ssh_packet_close; ok djm semarie
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/packet.c4
-rw-r--r--usr.bin/ssh/ssh_api.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index 0b326e9f7dc..c748dcf31cd 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.294 2020/06/26 11:26:01 semarie Exp $ */
+/* $OpenBSD: packet.c,v 1.295 2020/07/01 16:28:31 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -629,6 +629,8 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
ssh->remote_ipaddr = NULL;
free(ssh->state);
ssh->state = NULL;
+ kex_free(ssh->kex);
+ ssh->kex = NULL;
}
}
diff --git a/usr.bin/ssh/ssh_api.c b/usr.bin/ssh/ssh_api.c
index 7d25da36c1c..68b2c14391e 100644
--- a/usr.bin/ssh/ssh_api.c
+++ b/usr.bin/ssh/ssh_api.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh_api.c,v 1.19 2019/10/31 21:23:19 djm Exp $ */
+/* $OpenBSD: ssh_api.c,v 1.20 2020/07/01 16:28:31 markus Exp $ */
/*
* Copyright (c) 2012 Markus Friedl. All rights reserved.
*
@@ -146,7 +146,6 @@ ssh_free(struct ssh *ssh)
{
struct key_entry *k;
- ssh_packet_close(ssh);
/*
* we've only created the public keys variants in case we
* are a acting as a server.
@@ -161,8 +160,7 @@ ssh_free(struct ssh *ssh)
TAILQ_REMOVE(&ssh->private_keys, k, next);
free(k);
}
- if (ssh->kex)
- kex_free(ssh->kex);
+ ssh_packet_close(ssh);
free(ssh);
}