[php-src] PR #22382: Fix session save-handler argv leak on recursive rejection
| From: | iliaal | Date: | Sun, 21 Jun 2026 11:08:25 +0000 |
| Subject: | [php-src] PR #22382: Fix session save-handler argv leak on recursive rejection | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36529@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22382
Author: iliaal
ps_call_handler() returned on the recursive-call rejection branch before the argv cleanup loop,
leaking one ref per owned argument. The read/write/destroy callers copy the session id and data into
argv and rely on the function to release them, so a handler that re-enters session machinery (for
example calling session_destroy() from within a write handler) leaks those strings. Folding the call
into an else branch runs the cleanup unconditionally. Confirmed under USE_ZEND_ALLOC=0 valgrind: 64
bytes definitely lost, gone after the fix.