1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix memory leak when destroying PDORow
This commit is contained in:
Niels Dossche
2025-03-20 23:14:14 +01:00
3 changed files with 23 additions and 0 deletions

3
NEWS
View File

@@ -65,6 +65,9 @@ PHP NEWS
(nielsdos)
. Fixed bug GH-18112 (NULL access with preloading and INI option). (nielsdos)
- PDO:
. Fix memory leak when destroying PDORow. (nielsdos)
- Standard:
. Fix memory leaks in array_any() / array_all(). (nielsdos)

View File

@@ -2502,6 +2502,7 @@ void pdo_row_free_storage(zend_object *std)
ZVAL_UNDEF(&row->stmt->lazy_object_ref);
OBJ_RELEASE(&row->stmt->std);
}
zend_object_std_dtor(std);
}
zend_object *pdo_row_new(zend_class_entry *ce)

View File

@@ -0,0 +1,19 @@
--TEST--
GH-18114 (pdo lazy object crash)
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$x = $db->query('select 1 as queryString');
$data = $x->fetch(PDO::FETCH_LAZY);
foreach ($data as $entry) {
var_dump($entry);
}
var_dump((array) $data);
echo "Done\n";
?>
--EXPECT--
array(0) {
}
Done