Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memleak due to missing pthread_attr_destroy()-call #14510

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Zend/zend_call_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,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;
}

Expand All @@ -133,6 +134,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;
}

Expand All @@ -144,6 +146,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) */
Expand Down
Loading