aboutsummaryrefslogtreecommitdiff
path: root/src/wrapper.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-12-04 11:32:06 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-12-08 14:54:25 +0100
commit9c6404aa4976a6259509df37fda1e0399e0e1212 (patch)
treebb48f97721b6f55236e17e1cf7bc40460d804c26 /src/wrapper.c
parent455a161ed79a53a2f6f7ae57b51fc0e6e5fb6282 (diff)
downloadlibssh-9c6404aa4976a6259509df37fda1e0399e0e1212.tar.gz
libssh-9c6404aa4976a6259509df37fda1e0399e0e1212.tar.xz
libssh-9c6404aa4976a6259509df37fda1e0399e0e1212.zip
wrapper: Avoid memory leak on errors during key exchange
As reported by oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28075 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/wrapper.c')
-rw-r--r--src/wrapper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wrapper.c b/src/wrapper.c
index d53a61a3..bbd4e4b2 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -185,6 +185,7 @@ void crypto_free(struct ssh_crypto_struct *crypto)
crypto->ecdh_privkey = NULL;
}
#endif
+ SAFE_FREE(crypto->dh_server_signature);
if (crypto->session_id != NULL) {
explicit_bzero(crypto->session_id, crypto->digest_len);
SAFE_FREE(crypto->session_id);