diff --git a/include/ArduinoJson/Internals/JsonBufferAllocated.hpp b/include/ArduinoJson/Internals/JsonBufferAllocated.hpp index 148a99ac..b06ce6cf 100644 --- a/include/ArduinoJson/Internals/JsonBufferAllocated.hpp +++ b/include/ArduinoJson/Internals/JsonBufferAllocated.hpp @@ -14,6 +14,7 @@ namespace Internals { class JsonBufferAllocated { public: void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() { + if (!jsonBuffer) return NULL; return jsonBuffer->alloc(n); } diff --git a/include/ArduinoJson/JsonVariantBase.hpp b/include/ArduinoJson/JsonVariantBase.hpp index 6939702f..c85ad12d 100644 --- a/include/ArduinoJson/JsonVariantBase.hpp +++ b/include/ArduinoJson/JsonVariantBase.hpp @@ -79,9 +79,6 @@ class JsonVariantBase { FORCE_INLINE const JsonObjectSubscript operator[](const char *key) const; FORCE_INLINE const JsonObjectSubscript operator[](const String &key) const; - protected: - JsonVariantBase() {} - private: const TImpl *impl() const { return static_cast(this); } }; diff --git a/src/Internals/List.cpp b/src/Internals/List.cpp index 96f8503a..5275f8fc 100644 --- a/src/Internals/List.cpp +++ b/src/Internals/List.cpp @@ -21,8 +21,6 @@ size_t List::size() const { template typename List::node_type *List::addNewNode() { - if (!_buffer) return NULL; - node_type *newNode = new (_buffer) node_type(); if (_firstNode) {