Skip to content

Commit 6dd7925

Browse files
committed
Merge branch 'fix/memory_leak' into 'main'
Fix Memory Leak in Cluster Destroy by Freeing Attribute Metadata See merge request app-frameworks/esp-matter!1072
2 parents 24cd418 + 5de0715 commit 6dd7925

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/esp_matter/esp_matter_core.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,12 @@ static esp_err_t destroy(cluster_t *cluster)
15211521
/* Parse and delete all events */
15221522
SinglyLinkedList<_event_t>::delete_list(&current_cluster->event_list);
15231523

1524+
/* Free matter_attributes if allocated */
1525+
if (current_cluster->matter_attributes) {
1526+
esp_matter_mem_free(current_cluster->matter_attributes);
1527+
current_cluster->matter_attributes = NULL;
1528+
}
1529+
15241530
/* Free */
15251531
esp_matter_mem_free(current_cluster);
15261532
return ESP_OK;

0 commit comments

Comments
 (0)