mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-15 22:56:32 +00:00

The attr typically located on the stack is of an opaque pthread_attr_t type, which may be a pointer that gets initialized by pthread_attr_init(). Explicitly clean up the attr with pthread_attr_destroy() to avoid a leak on such platforms to avoid unexpected test failures with lsan enabled. This primarily affects FreeBSD; NetBSD, musl, and glibc will seemingly all use a full-sized pthread_attr_t.