|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79038 PDOStatement::nextRowset() leaks column values
Submitted: 2019-12-27 12:08 UTC Modified: 2020-02-17 21:57 UTC
From: Assigned: cmb (profile)
Status: Closed Package: PDO ODBC
PHP Version: 7.3Git-2019-12-27 (Git) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2019-12-27 12:08 UTC]
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:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-27 12:08 UTC]
-Assigned To: +Assigned To: cmb
 [2019-12-27 12:29 UTC]
The following pull request has been associated:

Patch Name: Fix #79038: PDOStatement::nextRowset() leaks column values
On GitHub:
 [2019-12-27 12:30 UTC]
-Assigned To: cmb +Assigned To:
 [2020-02-17 21:56 UTC]
Automatic comment on behalf of
Log: Fix #79038: PDOStatement::nextRowset() leaks column values
 [2020-02-17 21:56 UTC]
-Status: Open +Status: Closed
 [2020-02-17 21:57 UTC]
-Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 23:01:30 2024 UTC