The instance of E_Policy_Client has to be freed even though the member
variable `zone` is null.
The zone of E_Policy_Client instance may be NULL until it receives ecore
event, E_EVENT_CLIENT_ZONE_SET. If the callback of E_CLIENT_HOOK_DEL is
called before E_EVENT_CLIENT_ZONE_SET, the callback would return doing
nothing and the `pc` would be remained in hash table, and this will
cause use-after-free.
Change-Id: I14cde4159a2e0bf108d5dacd9897744459a129f7
pc = eina_hash_find(hash_policy_clients, &ec);
if (!pc) return;
- if (!pc->zone) return;
if (!pc->ec) return;
- e_tzsh_indicator_srv_ower_win_update(pc->zone);
+ if (pc->zone)
+ e_tzsh_indicator_srv_ower_win_update(pc->zone);
+
e_policy_wl_win_brightness_apply(pc->ec);
e_policy_wl_client_del(pc->ec);