diff --git a/NEWS b/NEWS index 515403ebc22..2f59ce7987d 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ PHP NEWS . Fixed #79114 (Eval class during preload causes class to be only half available). (Laruence) +- OpenSSL: + . Fixed bug #79145 (openssl memory leak). (cmb, Nikita) + - Reflection: . Fixed bug #79115 (ReflectionClass::isCloneable call reflected class __destruct). (Nikita) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f566d4e6edb..04cb9b0f231 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4767,7 +4767,6 @@ PHP_FUNCTION(openssl_pkey_get_public) RETURN_FALSE; } ZVAL_RES(return_value, res); - Z_ADDREF_P(return_value); } /* }}} */ @@ -4809,7 +4808,6 @@ PHP_FUNCTION(openssl_pkey_get_private) RETURN_FALSE; } ZVAL_RES(return_value, res); - Z_ADDREF_P(return_value); } /* }}} */ diff --git a/ext/openssl/tests/bug79145.phpt b/ext/openssl/tests/bug79145.phpt new file mode 100644 index 00000000000..348831189b6 --- /dev/null +++ b/ext/openssl/tests/bug79145.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #79145 (openssl memory leak) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true)