Bug #79038 [PATCH]: PDOStatement::nextRowset() leaks column values
| From: | cmb@php.net | Date: | Fri, 27 Dec 2019 12:29:56 +0000 |
| Subject: | Bug #79038 [PATCH]: PDOStatement::nextRowset() leaks column values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224554@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
Patch added by: cmb@php.net
Reported by: cmb@php.net
Summary: PDOStatement::nextRowset() leaks column values
Status: Assigned
Type: Bug
Package: PDO ODBC
Operating System: *
PHP Version: 7.3Git-2019-12-27 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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