Skip to content
Closed
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions Zend/zend_call_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack)

error = pthread_getattr_np(pthread_self(), &attr);
if (error) {
pthread_attr_destroy(&attr);
return false;
}

error = pthread_attr_getstack(&attr, &addr, &max_size);
if (error) {
pthread_attr_destroy(&attr);
return false;
}

Expand All @@ -133,6 +135,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 +147,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