Skip to content

Free cwd state in cwd_globals_dtor function#22398

Open
cheplv wants to merge 1 commit into
php:masterfrom
cheplv:fix-memleak-zend-virtual-cwd-dtor
Open

Free cwd state in cwd_globals_dtor function#22398
cheplv wants to merge 1 commit into
php:masterfrom
cheplv:fix-memleak-zend-virtual-cwd-dtor

Conversation

@cheplv

@cheplv cheplv commented Jun 22, 2026

Copy link
Copy Markdown

Fix memleak on destructor

Fix memleak on ZTS destructor

@Girgias Girgias 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.

Not a ZTS expert, but does this need to be gated by a #ifdef ZTS preprocessor guard? As this function is both called in NTS and ZTS builds

@cheplv

cheplv commented Jun 24, 2026

Copy link
Copy Markdown
Author

@Girgias No need - this is related to both NTS, ZTS modes - due copy is in CTOR so we must free in DTOR

CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state);

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