From 67b7b383b24ecdd100146276f0c2f033608e4ae2 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 4 Dec 2020 11:32:06 +0100 Subject: [PATCH] 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 Reviewed-by: Andreas Schneider (cherry picked from commit 9c6404aa4976a6259509df37fda1e0399e0e1212) --- src/wrapper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wrapper.c b/src/wrapper.c index 7e57ab5d..06fbe5f9 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -182,6 +182,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);