Skip to content

Commit 5de0715

Browse files
pimpalemaheshesp
authored and
esp
committed
fix: free attribute metadata memory in cluster destroy
1 parent 24cd418 commit 5de0715

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)