mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix memory leak when destroying PDORow
This should call zend_object_std_dtor() to clean the property table etc. This also has a semantic influence because previously weak refs were not notified for example. This fixes the final issue in GH-18114 (the crash was master-only and fixed already). Closes GH-18114. Closes GH-18123.
This commit is contained in:
parent
6af240d8da
commit
2dde07af55
3 changed files with 23 additions and 0 deletions
19
ext/pdo_sqlite/tests/gh18114.phpt
Normal file
19
ext/pdo_sqlite/tests/gh18114.phpt
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue