diff --git a/NEWS b/NEWS index 9a740d450c9..9bf3d19620f 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ PHP NEWS . Adjusted closure names to include the parent function's name. (timwolla) . Improve randomness of uploaded file names and files created by tempnam(). (Arnaud) + . Fixed bug GH-14510 (memleak due to missing pthread_attr_destroy()-call). + (Florian Engelhardt) - Curl: . Deprecated the CURLOPT_BINARYTRANSFER constant. (divinity76) @@ -196,7 +198,7 @@ PHP NEWS . Added class Pdo\Pgsql. (danack, kocsismate) . Retrieve the memory usage of the query result resource. (KentarouTakeda) . Added Pdo\Pgsql::setNoticeCallBack method to receive DB notices. - (outtersg) + (outtersg) - PDO_SQLITE: . Added class Pdo\Sqlite. (danack, kocsismate) diff --git a/Zend/zend_call_stack.c b/Zend/zend_call_stack.c index cc10a2aa309..4228e2e75a9 100644 --- a/Zend/zend_call_stack.c +++ b/Zend/zend_call_stack.c @@ -139,6 +139,7 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack) error = pthread_attr_getstack(&attr, &addr, &max_size); if (error) { + pthread_attr_destroy(&attr); return false; } @@ -148,6 +149,7 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack) /* In glibc prior to 2.8, addr and size include the guard pages */ error = pthread_attr_getguardsize(&attr, &guard_size); if (error) { + pthread_attr_destroy(&attr); return false; } @@ -159,6 +161,8 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack) stack->base = (int8_t*)addr + max_size; stack->max_size = max_size; + pthread_attr_destroy(&attr); + return true; } # else /* defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) */