From 353de1487fd53a164ee36c60fe716c4388ac6039 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 14 Jun 2019 11:42:11 +0200 Subject: [PATCH] log: fix minor memory leak when cleaning list of log levels --- components/log/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/log/log.c b/components/log/log.c index 72c232c68b..c59469cc02 100644 --- a/components/log/log.c +++ b/components/log/log.c @@ -174,8 +174,10 @@ void esp_log_level_set(const char* tag, esp_log_level_t level) void clear_log_level_list() { - while( !SLIST_EMPTY(&s_log_tags)) { + uncached_tag_entry_t *it; + while((it = SLIST_FIRST(&s_log_tags)) != NULL) { SLIST_REMOVE_HEAD(&s_log_tags, entries ); + free(it); } s_log_cache_entry_count = 0; s_log_cache_max_generation = 0;