Skip to content

fix(webserver): free for() header expression lists in embedded PHP interpreter - #109

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues5
Jun 11, 2026
Merged

fix(webserver): free for() header expression lists in embedded PHP interpreter#109
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues5

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

The three clauses of a for() header are comma-separated expression lists (PHP_OP_LIST chains). php_exp_tree_free() had no PHP_OP_LIST case, so list nodes fell through to the default branch, which frees tree_node.left/right but never the exp_node payloads — leaking every init/cond/step subtree once per parsed for() loop (echo and switch avoided this by walking their lists inline). Add a PHP_OP_LIST case that walks the ->next chain and frees both the payloads and the list spine.

…terpreter

The three clauses of a for() header are comma-separated expression lists
(PHP_OP_LIST chains). php_exp_tree_free() had no PHP_OP_LIST case, so list
nodes fell through to the default branch, which frees tree_node.left/right
but never the exp_node payloads — leaking every init/cond/step subtree once
per parsed for() loop (echo and switch avoided this by walking their lists
inline). Add a PHP_OP_LIST case that walks the ->next chain and frees both
the payloads and the list spine.
@ngosang
ngosang merged commit 4b3c7b9 into amule-org:master Jun 11, 2026
10 checks passed
@ngosang
ngosang deleted the feature/issues5 branch June 11, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant