### Description Dynamic memory, referenced by `res`, is allocated at *phpdbg_utils.c:154* : https://github.com/php/php-src/blob/cde956a2b0592f5fd9591e423abc22f07be9d4b6/sapi/phpdbg/phpdbg_utils.c#L146-L155 by calling function `phpdbg_resolve_path` at *phpdbg_prompt.c:405* and lost at *phpdbg_prompt.c:411* : https://github.com/php/php-src/blob/cde956a2b0592f5fd9591e423abc22f07be9d4b6/sapi/phpdbg/phpdbg_prompt.c#L405-L412 The allocated memory will be lost even if the condition at *phpdbg_prompt.c:408* is false. Found by Linux Verification Center ([portal.linuxtesting.ru](https://portal.linuxtesting.ru/)) with SVACE. Author E. Bykhanova. ### PHP Version PHP 8.2.3 ### Operating System ALT Linux
Activity
[-]MEMORY_LEAK in /sapi/phpdbg/phpdbg_prompt.c[/-][+]MEMORY_LEAK in phpdbg_prompt.c[/+]ndossche commentedon Nov 15, 2023
There's even a second one in the
Execution context not changedpath. I'll get to it.Thanks for reporting!
Fix phpGH-12675: MEMORY_LEAK in phpdbg_prompt.c
Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3'
Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c