File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ PHP NEWS
1010 values during Generator->throw()). (Bob)
1111 . Fixed bug GH-14456 (Attempting to initialize class with private constructor
1212 calls destructor). (Girgias)
13+ . Fixed bug GH-14510 (memleak due to missing pthread_attr_destroy()-call).
14+ (Florian Engelhardt)
1315
1416- BCMatch:
1517 . Fixed bug (bcpowmod() with mod = -1 returns 1 when it must be 0). (Girgias)
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack)
124124
125125 error = pthread_attr_getstack (& attr , & addr , & max_size );
126126 if (error ) {
127+ pthread_attr_destroy (& attr );
127128 return false;
128129 }
129130
@@ -133,6 +134,7 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack)
133134 /* In glibc prior to 2.8, addr and size include the guard pages */
134135 error = pthread_attr_getguardsize (& attr , & guard_size );
135136 if (error ) {
137+ pthread_attr_destroy (& attr );
136138 return false;
137139 }
138140
@@ -144,6 +146,8 @@ static bool zend_call_stack_get_linux_pthread(zend_call_stack *stack)
144146 stack -> base = (int8_t * )addr + max_size ;
145147 stack -> max_size = max_size ;
146148
149+ pthread_attr_destroy (& attr );
150+
147151 return true;
148152}
149153# else /* defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) */
You can’t perform that action at this time.
0 commit comments