[PATCH openEuler-5.10-LTS 416/427] thermal/core: Fix memory leak in the error path