Don't leak the allocated client object if we are returning null from

e_client_new

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-03-19 08:36:34 +00:00
parent 5b77c566e6
commit 52532f9a32
1 changed files with 7 additions and 1 deletions

View File

@ -2263,7 +2263,13 @@ e_client_new(E_Comp *c, E_Pixmap *cp, int first_map, int internal)
ec->new_client = 1;
ec->comp->new_clients++;
if (!_e_client_hook_call(E_CLIENT_HOOK_NEW_CLIENT, ec)) return NULL;
if (!_e_client_hook_call(E_CLIENT_HOOK_NEW_CLIENT, ec))
{
/* delete the above allocated object */
e_object_del(E_OBJECT(ec));
return NULL;
}
if (ec->override)
_e_client_zone_update(ec);
else