summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2008-01-15 15:12:47 +0000
committerRob Richards <rrichards@php.net>2008-01-15 15:12:47 +0000
commitde777461c5735be040713a5d5fefb6628ed72d6b (patch)
tree41ddbfe5ca5e9f6a492fb893c552c45cb20aa208 /ext/openssl
parent374f3062f86c2be50ca7831e7c4f9bd158ed9500 (diff)
downloadphp-git-de777461c5735be040713a5d5fefb6628ed72d6b.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 cda630703b..5c2f443df7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -3716,6 +3716,7 @@ PHP_FUNCTION(openssl_sign)
efree(sigbuf);
RETVAL_FALSE;
}
+ EVP_MD_CTX_cleanup(&md_ctx);
if (keyresource == -1) {
EVP_PKEY_free(pkey);
}
@@ -3766,6 +3767,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);