Skip to content

Commit 6eb4f45

Browse files
committed
Tests: ControllableAllocator controls reallocate() too
1 parent b3132ca commit 6eb4f45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extras/tests/Helpers/Allocators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class ControllableAllocator : public ArduinoJson::Allocator {
171171
}
172172

173173
void* reallocate(void* ptr, size_t n) override {
174-
return _upstream->reallocate(ptr, n);
174+
return _enabled ? _upstream->reallocate(ptr, n) : 0;
175175
}
176176

177177
void disable() {

0 commit comments

Comments
 (0)