summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2020-12-04 02:27:58 +0000
committerDamien Miller <djm@cvs.openbsd.org>2020-12-04 02:27:58 +0000
commit67bb496536bd7ed281b08ae01807cffc0d3d22de (patch)
tree236f1c312f6f0e647e0b196a00fa72615384ba36
parent0dc499dfef27833bae9a64ec35dd0e0fb6e0b1d8 (diff)
fix minor memleak of kex->hostkey_alg on rekex
-rw-r--r--usr.bin/ssh/kex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c
index 1c8443903ec..e7b3e4d7491 100644
--- a/usr.bin/ssh/kex.c
+++ b/usr.bin/ssh/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.161 2020/12/04 02:27:08 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.162 2020/12/04 02:27:57 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -822,6 +822,7 @@ choose_kex(struct kex *k, char *client, char *server)
static int
choose_hostkeyalg(struct kex *k, char *client, char *server)
{
+ free(k->hostkey_alg);
k->hostkey_alg = match_list(client, server, NULL);
debug("kex: host key algorithm: %s",