Don't dereference NULL pointers in sysinfo and cpuclock.

This fixes @CID1379941 and @CID1379947
This commit is contained in:
Stephen 'Okra' Houston 2017-08-25 14:57:45 -05:00
parent 1d72713dc0
commit 4a22d2f178
2 changed files with 4 additions and 2 deletions

View File

@ -853,7 +853,8 @@ _cpuclock_cb_frequency_check_notify(void *data,
Eina_Bool init_set = EINA_FALSE;
Thread_Config *thc = data;
if (!thc->inst && !thc->inst->cfg) return;
if (!thc->inst) return;
if (!thc->inst->cfg) return;
if (thc->inst->cfg->esm != E_SYSINFO_MODULE_CPUCLOCK && thc->inst->cfg->esm != E_SYSINFO_MODULE_SYSINFO) return;
if ((thc->inst->cfg->cpuclock.status) && (status) &&

View File

@ -7,6 +7,7 @@ _sysinfo_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
{
Instance *inst = data;
if (!inst) return;
if (inst->o_main != event_data) return;
sysinfo_batman_remove(inst, NULL, NULL, NULL);
sysinfo_thermal_remove(inst, NULL, NULL, NULL);
@ -17,7 +18,7 @@ _sysinfo_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
evas_object_smart_callback_del_full(e_gadget_site_get(obj), "gadget_removed", _sysinfo_removed_cb, inst);
evas_object_event_callback_del_full(inst->o_main, EVAS_CALLBACK_DEL, _sysinfo_deleted_cb, data);
if (inst && inst->cfg)
if (inst->cfg)
{
sysinfo_config->items = eina_list_remove(sysinfo_config->items, inst->cfg);
if (inst->cfg->id >= 0)