Fix thermal device list cleanup on early exits
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-08-12 16:52:17 +02:00
parent 4db1d0ff3f
commit 31fc429ba5

View file

@ -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);
}