Skip to content

Commit b44a17c

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
2 parents 5a459f6 + 789a37f commit b44a17c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.1.9
44

5+
- CLI:
6+
. Fixed potential overflow for the builtin server via the PHP_CLI_SERVER_WORKERS
7+
environment variable. (yiyuaner)
8+
59
- Core:
610
. Fixed bug GH-8923 (error_log on Windows can hold the file write lock). (cmb)
711

sapi/cli/php_cli_server.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ static void php_cli_server_dtor(php_cli_server *server) /* {{{ */
22962296
!WIFSIGNALED(php_cli_server_worker_status));
22972297
}
22982298

2299-
free(php_cli_server_workers);
2299+
pefree(php_cli_server_workers, 1);
23002300
}
23012301
#endif
23022302
} /* }}} */
@@ -2382,12 +2382,8 @@ static void php_cli_server_startup_workers(void) {
23822382
if (php_cli_server_workers_max > 1) {
23832383
zend_long php_cli_server_worker;
23842384

2385-
php_cli_server_workers = calloc(
2386-
php_cli_server_workers_max, sizeof(pid_t));
2387-
if (!php_cli_server_workers) {
2388-
php_cli_server_workers_max = 1;
2389-
return;
2390-
}
2385+
php_cli_server_workers = pecalloc(
2386+
php_cli_server_workers_max, sizeof(pid_t), 1);
23912387

23922388
php_cli_server_master = getpid();
23932389

0 commit comments

Comments
 (0)