Skip to content

Commit 3f02cfa

Browse files
committed
Fix leak introduced by phpGH-8241
Temporarily store result of ini bulder in ini_entries to avoid a leak when main() exists prematurely. Technically ini_entries isn't released either but ASAN doesn't consider unreleased memory referenced from globals leaks.
1 parent 8f02d7b commit 3f02cfa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sapi/fpm/fpm/fpm_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,8 @@ int main(int argc, char *argv[])
15861586
case 'd':
15871587
/* define ini entries on command line */
15881588
php_ini_builder_define(&ini_builder, php_optarg);
1589+
/* main can terminate without finishing or deiniting the ini builder, call finish each iteration to avoid leaking the buffer */
1590+
cgi_sapi_module.ini_entries = php_ini_builder_finish(&ini_builder);
15891591
break;
15901592

15911593
case 'y':

0 commit comments

Comments
 (0)