[base] Don't destroy pthread_attr if it failed to be created

The issue popped up while implementing conservative stack scanning in
V8.

Bug: v8:10614
Change-Id: I7edc6ca1f248f45b10be0fa45e28a98fd2b03840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2362651
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69476}
This commit is contained in:
Anton Bikineev 2020-08-19 05:19:09 +02:00 committed by Commit Bot
parent f7a4c31172
commit 7c9d30f55e

View File

@ -1009,7 +1009,6 @@ void* Stack::GetStackStart() {
pthread_attr_destroy(&attr);
return reinterpret_cast<uint8_t*>(base) + size;
}
pthread_attr_destroy(&attr);
#if defined(V8_LIBC_GLIBC)
// pthread_getattr_np can fail for the main thread. In this case