Skip to content

ext/pdo: Release driver options after bindParam and bindColumn - #23936

Closed
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/pdo-driver-options-refcount-84
Closed

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/pdo-driver-options-refcount-84

Conversation

@iliaal

@iliaal iliaal commented Sep 26, 2026

Copy link
Copy Markdown
Member

bindParam() and bindColumn() copied the driver options zval and then increased its refcount again, so the value stayed alive after the statement was destroyed. The copy keeps a single reference, and that reference is released with the binding.

bindParam() and bindColumn() copied the driver options zval and then
addref'd it again. The extra reference kept the value alive after the
statement was destroyed. Keep the single reference from the copy.

@SakiTakamachi SakiTakamachi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It's probably a leftover from the PHP 5 era.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants