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
65
65
(nielsdos)
66
66
. Fixed bug GH-18112 (NULL access with preloading and INI option). (nielsdos)
67
67
68
+ - PDO:
69
+ . Fix memory leak when destroying PDORow. (nielsdos)
70
+
68
71
- Standard:
69
72
. Fix memory leaks in array_any() / array_all(). (nielsdos)
70
73
Original file line number Diff line number Diff line change @@ -2502,6 +2502,7 @@ void pdo_row_free_storage(zend_object *std)
2502
2502
ZVAL_UNDEF (& row -> stmt -> lazy_object_ref );
2503
2503
OBJ_RELEASE (& row -> stmt -> std );
2504
2504
}
2505
+ zend_object_std_dtor (std );
2505
2506
}
2506
2507
2507
2508
zend_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