[php-src] PR #25159: ext/pdo_dblib: Release persistent handle error strings at request end
| From: | iliaal | Date: | Mon, 02 Nov 2026 16:14:15 +0000 |
| Subject: | [php-src] PR #25159: ext/pdo_dblib: Release persistent handle error strings at request end | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40236@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25159
Author: iliaal
The DB-Lib message and error handlers estrdup() server text into the connection's error state,
and on a persistent connection an error raised through
PDO::exec() (or, since GH-23741,
the transaction calls and lastInsertId()) stays there past the end of the request, so
the next request or the handle close at shutdown efree()s pointers into a reset request heap. A
persistent_shutdown handler now frees them once the last PDO object using the
connection is released, the same refcount check pdo_dbh_free_storage() uses before
rolling back; keeping the strings persistent instead would let a later timeout report the previous
request's message.