mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pcntl: Fix cpuset leak in pcntl_setcpuaffinity on out-of-range CPU ID
Add missing PCNTL_CPU_DESTROY(mask) call before RETURN_THROWS() when the cpu id is out of range, matching the cleanup on other error paths. close GH-21268
This commit is contained in:
2
NEWS
2
NEWS
@@ -44,6 +44,8 @@ PHP NEWS
|
||||
- PCNTL:
|
||||
. Fixed pcntl_setns() internal errors handling regarding errnos.
|
||||
(David Carlier)
|
||||
. Fixed cpuset leak in pcntl_setcpuaffinity on out-of-range CPU ID
|
||||
on NetBSD/Solaris platforms. (David Carlier)
|
||||
|
||||
- PDO_PGSQL:
|
||||
. Fixed bug GH-21055 (connection attribute status typo for GSS negotiation).
|
||||
|
||||
@@ -1734,6 +1734,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
|
||||
|
||||
if (cpu < 0 || cpu >= maxcpus) {
|
||||
zend_argument_value_error(2, "cpu id must be between 0 and " ZEND_ULONG_FMT " (" ZEND_LONG_FMT ")", maxcpus, cpu);
|
||||
PCNTL_CPU_DESTROY(mask);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user