1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00

bot concerns

This commit is contained in:
J. Nick Koston
2026-01-15 18:19:15 -10:00
parent 9bdefc98b1
commit 42b9863cd3

View File

@@ -180,6 +180,7 @@ template<size_t InlineSize = 8> class SmallInlineBuffer {
// Free existing heap allocation if switching from heap to inline or different heap size
if (!this->is_inline_() && (size <= InlineSize || size != this->len_)) {
delete[] this->heap_;
this->heap_ = nullptr; // Defensive: prevent use-after-free if logic changes
}
// Allocate new heap buffer if needed
if (size > InlineSize && (this->is_inline_() || size != this->len_)) {