From 42b9863cd3429b25d431d3d095dff8297b1872d3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 15 Jan 2026 18:19:15 -1000 Subject: [PATCH] bot concerns --- esphome/core/helpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index e33027f39f..39a4c5cd78 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -180,6 +180,7 @@ template 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_)) {