[php-src] PR #12132: Fix persistent procedural ODBC connections not getting closed (8.1)
| From: | NattyNarwhal | Date: | Tue, 05 Sep 2023 14:32:04 +0000 |
| Subject: | [php-src] PR #12132: Fix persistent procedural ODBC connections not getting closed (8.1) | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23575@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12132
Author: NattyNarwhal
Like oci8, procedural ODBC uses an apply function on the hash list to enumerate persistent
connections and close the specific one. However, this function take zvals, not resources. However,
it was getting casted as such, causing it to interpret the pointer incorrectly. This could have
caused other issues, but mostly manifested as failing to close the connection even fi it matched.
The function now takes a zval and gets the resource from that. In addition, it also removes the cast
of the function pointer and moves casting to the function body, to avoid possible confusion like
this in refactors again. It also cleans up style and uses constants in the function body.
(This PR is GH-12096, but rebased onto PHP 8.1 instead.)