File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ PHP NEWS
6565 (nielsdos)
6666 . Fixed bug GH-18112 (NULL access with preloading and INI option). (nielsdos)
6767
68+ - PDO:
69+ . Fix memory leak when destroying PDORow. (nielsdos)
70+
6871- Standard:
6972 . Fix memory leaks in array_any() / array_all(). (nielsdos)
7073
Original file line number Diff line number Diff line change @@ -2502,6 +2502,7 @@ void pdo_row_free_storage(zend_object *std)
25022502 ZVAL_UNDEF (& row -> stmt -> lazy_object_ref );
25032503 OBJ_RELEASE (& row -> stmt -> std );
25042504 }
2505+ zend_object_std_dtor (std );
25052506}
25062507
25072508zend_object * pdo_row_new (zend_class_entry * ce )
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-18114 (pdo lazy object crash)
3+ --EXTENSIONS--
4+ pdo_sqlite
5+ --FILE--
6+ <?php
7+ $ db = new PDO ('sqlite::memory: ' );
8+ $ x = $ db ->query ('select 1 as queryString ' );
9+ $ data = $ x ->fetch (PDO ::FETCH_LAZY );
10+ foreach ($ data as $ entry ) {
11+ var_dump ($ entry );
12+ }
13+ var_dump ((array ) $ data );
14+ echo "Done \n" ;
15+ ?>
16+ --EXPECT--
17+ array(0) {
18+ }
19+ Done
You can’t perform that action at this time.
0 commit comments