@@ -1921,6 +1921,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
1921
1921
1922
1922
if (!EVP_SignInit (md_ctx , mdtype )) {
1923
1923
EVP_PKEY_free (key );
1924
+ EVP_MD_CTX_free (md_ctx );
1924
1925
efree (sigbuf );
1925
1926
if (error ) {
1926
1927
spprintf (error , 0 , "unable to initialize openssl signature for phar \"%s\"" , phar -> fname );
@@ -1931,6 +1932,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
1931
1932
while ((sig_len = php_stream_read (fp , (char * )buf , sizeof (buf ))) > 0 ) {
1932
1933
if (!EVP_SignUpdate (md_ctx , buf , sig_len )) {
1933
1934
EVP_PKEY_free (key );
1935
+ EVP_MD_CTX_free (md_ctx );
1934
1936
efree (sigbuf );
1935
1937
if (error ) {
1936
1938
spprintf (error , 0 , "unable to update the openssl signature for phar \"%s\"" , phar -> fname );
@@ -1941,6 +1943,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
1941
1943
1942
1944
if (!EVP_SignFinal (md_ctx , sigbuf , & siglen , key )) {
1943
1945
EVP_PKEY_free (key );
1946
+ EVP_MD_CTX_free (md_ctx );
1944
1947
efree (sigbuf );
1945
1948
if (error ) {
1946
1949
spprintf (error , 0 , "unable to write phar \"%s\" with requested openssl signature" , phar -> fname );
@@ -1950,7 +1953,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char
1950
1953
1951
1954
sigbuf [siglen ] = '\0' ;
1952
1955
EVP_PKEY_free (key );
1953
- EVP_MD_CTX_destroy (md_ctx );
1956
+ EVP_MD_CTX_free (md_ctx );
1954
1957
#else
1955
1958
size_t siglen ;
1956
1959
sigbuf = NULL ;
0 commit comments