devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=52532f9a324b34a90869fd541e090a0193019c0c

commit 52532f9a324b34a90869fd541e090a0193019c0c
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Mar 19 08:36:34 2014 +0000

    Don't leak the allocated client object if we are returning null from
    e_client_new
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/e_client.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 579a4eb..663aa03 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -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

-- 


Reply via email to