When there is no thermal scenario, thermal can not be initialized
and g_thermal is null. Exiting pass from the status, in
thermal_free(), there is null deference. Fix the possible null
deference.
Change-Id: I69ab200ea3d182adc628913d89306db6fe3ebcff
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
if (ret < 0)
_E("failed to put Thermal Monitor scenario\n");
- g_ptr_array_free(g_thermal->resources, TRUE);
+ if (g_thermal) {
+ g_ptr_array_free(g_thermal->resources, TRUE);
- free(g_thermal);
- g_thermal = NULL;
+ free(g_thermal);
+ g_thermal = NULL;
+ }
}
/**