diff --git a/extras/tests/Helpers/Allocators.hpp b/extras/tests/Helpers/Allocators.hpp index ba648794..862a5426 100644 --- a/extras/tests/Helpers/Allocators.hpp +++ b/extras/tests/Helpers/Allocators.hpp @@ -171,7 +171,7 @@ class ControllableAllocator : public ArduinoJson::Allocator { } void* reallocate(void* ptr, size_t n) override { - return _upstream->reallocate(ptr, n); + return _enabled ? _upstream->reallocate(ptr, n) : 0; } void disable() {