From 7eaec5ca70677645f5fe6fd9b5802a2a01f86b6e Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 12 Aug 2026 16:52:17 +0200 Subject: [PATCH] Fix thermal device list cleanup on early exits --- cmdline/thermal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmdline/thermal.c b/cmdline/thermal.c index 6d0545a7..ced0c63c 100644 --- a/cmdline/thermal.c +++ b/cmdline/thermal.c @@ -176,11 +176,11 @@ void state_thermal(struct snapraid_state* state, time_t now) /* on error, just disable thermal gathering */ if (ret != 0) - return; + goto bail; /* if the list is empty, it's not supported in this platform */ if (tommy_list_empty(&low)) - return; + goto bail; /* report new attribute */ state_attr(state, &low); @@ -289,6 +289,7 @@ void state_thermal(struct snapraid_state* state, time_t now) log_tag("thermal:highest:%d\n", highest_temperature); log_flush(); +bail: tommy_list_foreach(&high, free); tommy_list_foreach(&low, free); }