Skip to content

Commit d17eade

Browse files
authored
Do not call disable / enable on null depot (#82542)
depot can be null if allocation_ring_buffer_size=0
1 parent 9eff001 commit d17eade

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler-rt/lib/scudo/standalone/combined.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,12 +688,14 @@ class Allocator {
688688
Quarantine.disable();
689689
Primary.disable();
690690
Secondary.disable();
691-
Depot->disable();
691+
if (Depot)
692+
Depot->disable();
692693
}
693694

694695
void enable() NO_THREAD_SAFETY_ANALYSIS {
695696
initThreadMaybe();
696-
Depot->enable();
697+
if (Depot)
698+
Depot->enable();
697699
Secondary.enable();
698700
Primary.enable();
699701
Quarantine.enable();

0 commit comments

Comments
 (0)