Skip to content

Fix leak of resolved address list in snmp_session_init()#22340

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix-snmp-resolver-leak
Open

Fix leak of resolved address list in snmp_session_init()#22340
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix-snmp-resolver-leak

Conversation

@iliaal

@iliaal iliaal commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

When php_network_getaddresses() succeeds but no resolved address yields a usable peer name (for example bracketed IPv6 syntax over an IPv4-only host), snmp_session_init() returned without php_network_freeaddresses(), leaking the address list on every such call. Free it on that error path, matching the success path and the convention in main/network.c.

When php_network_getaddresses() succeeds but none of the resolved
addresses yield a usable peer name (for example bracketed IPv6 syntax
over an IPv4-only host), snmp_session_init() returned without calling
php_network_freeaddresses(), leaking the address list on every such call.
Free it on that error path as the success path already does.

Closes phpGH-22340
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.

1 participant