File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ PHP NEWS
15
15
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
16
16
(cmb)
17
17
18
+ - OpenSSL:
19
+ . Fixed bug #79145 (openssl memory leak). (cmb, Nikita)
20
+
18
21
- Reflection:
19
22
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
20
23
__destruct). (Nikita)
Original file line number Diff line number Diff line change @@ -4691,7 +4691,6 @@ PHP_FUNCTION(openssl_pkey_get_public)
4691
4691
RETURN_FALSE ;
4692
4692
}
4693
4693
ZVAL_RES (return_value , res );
4694
- Z_ADDREF_P (return_value );
4695
4694
}
4696
4695
/* }}} */
4697
4696
@@ -4733,7 +4732,6 @@ PHP_FUNCTION(openssl_pkey_get_private)
4733
4732
RETURN_FALSE ;
4734
4733
}
4735
4734
ZVAL_RES (return_value , res );
4736
- Z_ADDREF_P (return_value );
4737
4735
}
4738
4736
4739
4737
/* }}} */
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79145 (openssl memory leak)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('openssl ' )) die ('skip openssl extension not available ' );
6
+ if (getenv ('SKIP_SLOW_TESTS ' )) die ('skip slow test ' );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ b = '-----BEGIN PUBLIC KEY-----
11
+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDaFhc31WeskqxwI+Si5R/fZrLK
12
+ pJOlABiI3RZfKCHJVrXl3IvcHDFM/BHKUJoSi/ee8GS9iw0G4Z1eCzJdthXxHARh
13
+ j85Q5OliVxOdB1LoTOsOmfFf/fdvpU3DsOWsDKlVrL41MHxXorwrwOiys/r/gv2d
14
+ C9C4JmhTOjBVAK8SewIDAQAC
15
+ -----END PUBLIC KEY----- ' ;
16
+
17
+ $ start = memory_get_usage (true );
18
+ for ($ i = 0 ; $ i < 100000 ; $ i ++) {
19
+ $ a = openssl_get_publickey ($ b );
20
+ openssl_free_key ($ a );
21
+ }
22
+ $ end = memory_get_usage (true );
23
+ var_dump ($ end <= 1.1 * $ start );
24
+ ?>
25
+ --EXPECT--
26
+ bool(true)
You can’t perform that action at this time.
0 commit comments