diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-06 00:18:16 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-06 00:18:16 +0000 |
commit | 1611cc71581008a52e29df7334cb137b9679b94c (patch) | |
tree | 303549d1cf4bbedfa74e87152e1ee5af5bf5209c | |
parent | dee7b9c5a4f594ff53966d5d1c48fcef84d5ab15 (diff) | |
parent | a921990c0142920b21cc383ec297f19cd6f88648 (diff) | |
download | scudo-1611cc71581008a52e29df7334cb137b9679b94c.tar.gz |
Snap for 11180250 from a921990c0142920b21cc383ec297f19cd6f88648 to 24Q1-release
Change-Id: Ic124036ec67f211156c1f4cad86b6e06e473fc7e
-rw-r--r-- | standalone/combined.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/standalone/combined.h b/standalone/combined.h index 72e5caa026e..25ad11dbf7e 100644 --- a/standalone/combined.h +++ b/standalone/combined.h @@ -522,6 +522,9 @@ public: NOINLINE void deallocate(void *Ptr, Chunk::Origin Origin, uptr DeleteSize = 0, UNUSED uptr Alignment = MinAlignment) { + if (UNLIKELY(!Ptr)) + return; + // For a deallocation, we only ensure minimal initialization, meaning thread // local data will be left uninitialized for now (when using ELF TLS). The // fallback cache will be used instead. This is a workaround for a situation @@ -530,9 +533,6 @@ public: // being destroyed properly. Any other heap operation will do a full init. initThreadMaybe(/*MinimalInit=*/true); - if (UNLIKELY(!Ptr)) - return; - #ifdef GWP_ASAN_HOOKS if (UNLIKELY(GuardedAlloc.pointerIsMine(Ptr))) { GuardedAlloc.deallocate(Ptr); |