Skip to content

Fix Calendar::createInstance double-free of the adopted TimeZone - #23320

Open
iliaal wants to merge 1 commit into
php:masterfrom
iliaal:fix/intl-cal-create-df
Open

Fix Calendar::createInstance double-free of the adopted TimeZone#23320
iliaal wants to merge 1 commit into
php:masterfrom
iliaal:fix/intl-cal-create-df

Conversation

@iliaal

@iliaal iliaal commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

ICU 57+ Calendar::createInstance adopts the TimeZone and frees it if the calendar cannot be created. createInstance and fromDateTime deleted that pointer again on failure.

ICU 57+ Calendar::createInstance wraps the TimeZone in a LocalPointer
and deletes it when the calendar cannot be created. PHP deleted the
same pointer again on that failure. Drop the extra delete in
createInstance and fromDateTime.
@@ -0,0 +1,24 @@
--TEST--

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.

this test is kinda of useless, I would suggest to drop it.

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