Bug #79038 [Opn->Csd]: PDOStatement::nextRowset() leaks column values
| From: | cmb@php.net | Date: | Mon, 17 Feb 2020 21:56:21 +0000 |
| Subject: | Bug #79038 [Opn->Csd]: PDOStatement::nextRowset() leaks column values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225605@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79038&edit=1
ID: 79038
Updated by: cmb@php.net
Reported by: cmb@php.net
Summary: PDOStatement::nextRowset() leaks column values
-Status: Open
+Status: Closed
Type: Bug
Package: PDO ODBC
Operating System: *
PHP Version: 7.3Git-2019-12-27 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=08073b06581c6dc9234cfb2e9b187a598154c8ab
Log: Fix #79038: PDOStatement::nextRowset() leaks column values
Previous Comments:
------------------------------------------------------------------------
[2019-12-27 12:29:56] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #79038: PDOStatement::nextRowset() leaks column values
On GitHub: https://github.com/php/php-src/pull/5033
Patch: https://github.com/php/php-src/pull/5033.patch
------------------------------------------------------------------------
[2019-12-27 12:08:21] cmb@php.net
Description:
------------
The basic problem is that PDO core sets the
column_count to
zero, before the driver specific implementation of next_rowset
is called, so the column values are never freed. Since PDO_ODBC
does not implement cursor_closer, the memory leak also happens
when PDOStatement::closeCursor() called.
The leaks can be seen when the PDO_ODBC test suite is run on a
debug build on PHP-7.4, and also for PHP-7.3 when run with
valgrind or another leak checker.
Test script:
---------------
php run-tests.php ext/pdo_odbc/tests
Expected result:
----------------
no memory leaks
Actual result:
--------------
<https://ci.appveyor.com/project/php/php-src/builds/29760248/job/qrhd1plp255gxwmy#L4986>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79038&edit=1