summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-06 00:18:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-06 00:18:16 +0000
commit1611cc71581008a52e29df7334cb137b9679b94c (patch)
tree303549d1cf4bbedfa74e87152e1ee5af5bf5209c
parentdee7b9c5a4f594ff53966d5d1c48fcef84d5ab15 (diff)
parenta921990c0142920b21cc383ec297f19cd6f88648 (diff)
downloadscudo-1611cc71581008a52e29df7334cb137b9679b94c.tar.gz
Snap for 11180250 from a921990c0142920b21cc383ec297f19cd6f88648 to 24Q1-release
Change-Id: Ic124036ec67f211156c1f4cad86b6e06e473fc7e
-rw-r--r--standalone/combined.h6
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);