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