mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
crypto: fix potential memory leak in ECDH
This commit is contained in:
@@ -160,6 +160,10 @@ void crypto_free(struct ssh_crypto_struct *crypto){
|
|||||||
#ifdef HAVE_ECDH
|
#ifdef HAVE_ECDH
|
||||||
SAFE_FREE(crypto->ecdh_client_pubkey);
|
SAFE_FREE(crypto->ecdh_client_pubkey);
|
||||||
SAFE_FREE(crypto->ecdh_server_pubkey);
|
SAFE_FREE(crypto->ecdh_server_pubkey);
|
||||||
|
if(crypto->ecdh_privkey != NULL){
|
||||||
|
EC_KEY_free(crypto->ecdh_privkey);
|
||||||
|
crypto->ecdh_privkey = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if(crypto->session_id != NULL){
|
if(crypto->session_id != NULL){
|
||||||
memset(crypto->session_id, '\0', crypto->digest_len);
|
memset(crypto->session_id, '\0', crypto->digest_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user