test: fix pthread memory leak

When the thread attributes object returned by pthread_getattr_np() is no
longer required, it should be destroyed using pthread_attr_destroy().

PR-URL: https://github.com/libuv/libuv/pull/2583
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Trevor Norris 2019-12-19 13:34:16 -07:00 committed by cjihrig
parent 6432886e0d
commit bbb8b1ffac
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -232,6 +232,7 @@ static void thread_check_stack(void* arg) {
if (expected == 0)
expected = (size_t)lim.rlim_cur;
ASSERT(stack_size >= expected);
ASSERT(0 == pthread_attr_destroy(&attr));
#endif
}