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.
This commit is contained in:
Daniel Stenberg 2007-03-15 21:37:43 +00:00
parent 56f606a98e
commit ba9f0b2ce6

View File

@ -157,6 +157,8 @@ int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx,
libssh2_sha1(m, m_len, hash); libssh2_sha1(m, m_len, hash);
ret = DSA_do_verify(hash, SHA_DIGEST_LENGTH, &dsasig, dsactx); 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; return (ret == 1) ? 0 : -1;
} }