File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 6
6
. Fixed bug #79364 (When copy empty array, next key is unspecified). (cmb)
7
7
. Fixed bug #78210 (Invalid pointer address). (cmb, Nikita)
8
8
9
+ - CURL:
10
+ . Fixed bug #79199 (curl_copy_handle() memory leak). (cmb)
11
+
9
12
- SimpleXML:
10
13
. Fixed bug #61597 (SXE properties may lack attributes and content). (cmb)
11
14
Original file line number Diff line number Diff line change @@ -2167,8 +2167,6 @@ PHP_FUNCTION(curl_copy_handle)
2167
2167
2168
2168
_php_setup_easy_copy_handlers (dupch , ch );
2169
2169
2170
- Z_ADDREF_P (zid );
2171
-
2172
2170
ZVAL_RES (return_value , zend_register_resource (dupch , le_curl ));
2173
2171
dupch -> res = Z_RES_P (return_value );
2174
2172
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79199 (curl_copy_handle() memory leak)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('curl ' )) die ('skip curl extension not available ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ mem_old = 0 ;
10
+ for ($ i = 0 ; $ i < 50 ; ++$ i ) {
11
+ $ c1 = curl_init ();
12
+ $ c2 = curl_copy_handle ($ c1 );
13
+ curl_close ($ c2 );
14
+ curl_close ($ c1 );
15
+ $ mem_new = memory_get_usage ();
16
+ if ($ mem_new <= $ mem_old ) {
17
+ break ;
18
+ }
19
+ $ mem_old = $ mem_new ;
20
+ }
21
+ echo $ i < 50 ? "okay " : "leak " , PHP_EOL ;
22
+ ?>
23
+ --EXPECT--
24
+ okay
You can’t perform that action at this time.
0 commit comments