summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2008-01-15 15:13:37 +0000
committerRob Richards <rrichards@php.net>2008-01-15 15:13:37 +0000
commit844d6ee35b667653891bdccbfab59b7af5b14cad (patch)
tree6d6c39e68bcdde2cfe9ef02bfdd2c29c4f6ee7a1 /ext/openssl
parent751b0807b1b2c9b37366d368d941696ce760ad78 (diff)
downloadphp-git-844d6ee35b667653891bdccbfab59b7af5b14cad.tar.gz
MFH: fix memleak in sign and verify functions
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/openssl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c4f7c1e4c2..91856f548b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -3522,6 +3522,7 @@ PHP_FUNCTION(openssl_sign)
efree(sigbuf);
RETVAL_FALSE;
}
+ EVP_MD_CTX_cleanup(&md_ctx);
if (keyresource == -1) {
EVP_PKEY_free(pkey);
}
@@ -3561,6 +3562,7 @@ PHP_FUNCTION(openssl_verify)
EVP_VerifyInit (&md_ctx, mdtype);
EVP_VerifyUpdate (&md_ctx, data, data_len);
err = EVP_VerifyFinal (&md_ctx, (unsigned char *)signature, signature_len, pkey);
+ EVP_MD_CTX_cleanup(&md_ctx);
if (keyresource == -1) {
EVP_PKEY_free(pkey);