summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2020-06-24 15:12:10 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2020-06-24 15:12:10 +0000
commit63821225ae843d6afc1f17142e913034683cb3e9 (patch)
tree8d33e0ded8bb8fe1d8d7c55ea0b5d285c9315928
parent646bda54ce3cbe64b43efd43683ef24c5eda5499 (diff)
fix kex mem-leak in ssh_packet_close; ok djm
-rw-r--r--usr.bin/ssh/packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index 8f586d23384..02011bfc34b 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.292 2020/06/24 15:10:38 markus Exp $ */
+/* $OpenBSD: packet.c,v 1.293 2020/06/24 15:12:09 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -591,6 +591,8 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close)
state->newkeys[mode] = NULL;
ssh_clear_newkeys(ssh, mode); /* next keys */
}
+ kex_free(ssh->kex);
+ ssh->kex = NULL;
#ifdef WITH_ZLIB
/* compression state is in shared mem, so we can only release it once */
if (do_close && state->compression_buffer) {