Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GH-18114: pdo lazy object crash #18116

Merged
merged 2 commits into from
Mar 19, 2025
Merged

Fix GH-18114: pdo lazy object crash #18116

merged 2 commits into from
Mar 19, 2025

Conversation

nielsdos
Copy link
Member

Since 0537968, the properties are no longer initialized. So we call object_properties_init to handle that correctly. Lower branches have a memory leak, but that requires a separate fix.

Since 0537968, the properties are no longer initialized.
So we call object_properties_init to handle that correctly.
Lower branches have a memory leak, but that requires a separate fix.
@@ -2405,6 +2406,7 @@ static zend_object *pdo_row_new(zend_class_entry *ce)
{
pdo_row_t *row = zend_object_alloc(sizeof(pdo_row_t), ce);
zend_object_std_init(&row->std, ce);
object_properties_init(&row->std, pdo_row_ce);
Copy link
Member

Choose a reason for hiding this comment

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

question ; would ce just work here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep it would, in this case it's always the same. But it's cleaner to use ce. This is a copy-pasta leftover. Thanks for noticing

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

LGTM

@nielsdos nielsdos merged commit e1eeb48 into php:master Mar 19, 2025
9 checks passed
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.

pdo lazy object crash
2 participants