From e4853b4e08b120d4fa07bf4fbcf4406c08958c20 Mon Sep 17 00:00:00 2001 From: mahesh Date: Fri, 4 Apr 2025 12:23:57 +0530 Subject: [PATCH] Fix memory leak in endpoint destroy --- components/esp_matter/esp_matter_core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index 5a4d5ae31..698cba630 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -2078,6 +2078,10 @@ esp_err_t destroy(node_t *node, endpoint_t *endpoint) } /* Free */ + if (current_endpoint->identify != NULL) { + chip::Platform::Delete(current_endpoint->identify); + current_endpoint->identify = NULL; + } esp_matter_mem_free(current_endpoint); return ESP_OK; }