summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-12-04 02:27:57 +0000
committerdjm <djm@openbsd.org>2020-12-04 02:27:57 +0000
commit8317e2d2574a52a2248409034aff407e4acd1725 (patch)
tree58a556dad8c1bceb80bc563f379161da50499eb2
parenttypos: s/hex/kex/ in error messages (diff)
downloadwireguard-openbsd-8317e2d2574a52a2248409034aff407e4acd1725.tar.xz
wireguard-openbsd-8317e2d2574a52a2248409034aff407e4acd1725.zip
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",