policy: Fix use after free 75/313775/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 14 Jun 2024 07:13:12 +0000 (16:13 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 2 Jul 2024 01:17:30 +0000 (10:17 +0900)
commit3503a87a607c162a94b68c57ddbcb8026f6b47d7
tree35ac0643abbf3638154ce05ba407de0d174527b7
parentfdc1b7ba55625996b14926c40bf9197202730876
policy: Fix use after free

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
src/bin/e_policy.c