File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ void php_oci_column_hash_dtor(zval *data)
574574 }
575575
576576 if (column -> descid && !GC_DELREF (column -> descid )) {
577- zend_list_close (column -> descid );
577+ zend_list_free (column -> descid );
578578 }
579579
580580 if (column -> data ) {
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-18873 (OCI_RETURN_LOBS flag causes oci8 to leak memory)
3+ --EXTENSIONS--
4+ oci8
5+ --SKIPIF--
6+ <?php
7+ require_once 'skipifconnectfailure.inc ' ;
8+ ?>
9+ --FILE--
10+ <?php
11+ require __DIR__ .'/connect.inc ' ;
12+
13+ $ expectedStr = str_repeat ('a ' , 1_001 );
14+ $ sql = 'select concat(TO_CLOB( \'' . str_repeat ('a ' , 1_000 ) . '\'), TO_CLOB( \'a \')) AS "v" from "DUAL" ' ;
15+
16+ $ memUsages = array_flip (range (0 , 100 - 1 ));
17+ foreach (array_keys ($ memUsages ) as $ k ) {
18+ $ stid = oci_parse ($ c , $ sql );
19+ oci_execute ($ stid );
20+ $ row = oci_fetch_array ($ stid , \OCI_ASSOC | \OCI_RETURN_LOBS );
21+ $ res = $ row ['v ' ];
22+
23+ $ memUsages [$ k ] = memory_get_usage ();
24+ }
25+
26+ $ memUsages = array_slice ($ memUsages , 1 , null , true );
27+ $ memUsages = array_unique ($ memUsages );
28+
29+ if (count ($ memUsages ) !== 1 ) {
30+ var_dump ($ memUsages );
31+ throw new \Exception ('memory leak detected ' );
32+ }
33+
34+ echo "Done! \n" ;
35+ ?>
36+ --EXPECT--
37+ Done!
You can’t perform that action at this time.
0 commit comments