From ba9f0b2ce6f0a28b385194c58f226732dd3c5826 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 15 Mar 2007 21:37:43 +0000 Subject: [PATCH] Dan Fandrich fixed another memory leak, this time in the OpenSSL interface code: It's not clear to me whether all the BN_news in _libssh2_rsa_new need to be cleaned up, too. The OpenSSL docs for RSA_free implies that you don't need to, and valgrind doesn't complain, so it's probably OK as is. --- src/openssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openssl.c b/src/openssl.c index 64eba0b..358dd50 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -157,6 +157,8 @@ int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx, libssh2_sha1(m, m_len, hash); ret = DSA_do_verify(hash, SHA_DIGEST_LENGTH, &dsasig, dsactx); + BN_clear_free(dsasig.s); + BN_clear_free(dsasig.r); return (ret == 1) ? 0 : -1; }