mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 12:38:40 +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:
co-authored by
Otto winter
parent
f26767b65e
commit
c6c2842bdb
@@ -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