diff options
author | Jakub Jelen <jjelen@redhat.com> | 2020-12-04 11:32:06 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-12-08 14:54:25 +0100 |
commit | 9c6404aa4976a6259509df37fda1e0399e0e1212 (patch) | |
tree | bb48f97721b6f55236e17e1cf7bc40460d804c26 /src/wrapper.c | |
parent | 455a161ed79a53a2f6f7ae57b51fc0e6e5fb6282 (diff) | |
download | libssh-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.c | 1 |
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); |