mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 15:55:46 +00:00
Always abort on allocation when out-of-memory (#2129)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -14,7 +14,7 @@ const Color COLOR_OFF(0, 0, 0, 0);
|
||||
const Color COLOR_ON(255, 255, 255, 255);
|
||||
|
||||
void DisplayBuffer::init_internal_(uint32_t buffer_length) {
|
||||
this->buffer_ = new uint8_t[buffer_length];
|
||||
this->buffer_ = new (std::nothrow) uint8_t[buffer_length];
|
||||
if (this->buffer_ == nullptr) {
|
||||
ESP_LOGE(TAG, "Could not allocate buffer for display!");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user