diff --git a/NEWS b/NEWS index 8a0b3880255..d31c2d16042 100644 --- a/NEWS +++ b/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). diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 853215e39f9..e3b4a9c4c69 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -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(); }