upstream: free kex in ssh_packet_close; ok djm semarie

OpenBSD-Commit-ID: dbc181e90d3d32fd97b10d75e68e374270e070a2
This commit is contained in:
markus@openbsd.org 2020-07-01 16:28:31 +00:00 committed by Damien Miller
parent e1c401109b
commit 55ef3e9cbd
2 changed files with 5 additions and 5 deletions

View File

@ -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
@ -654,6 +654,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;
}
}

View File

@ -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.
*
@ -152,7 +152,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.
@ -167,8 +166,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);
}