devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=65bd5f91ee7f37b86cbda031d4be58328babfb53

commit 65bd5f91ee7f37b86cbda031d4be58328babfb53
Author: Chris Michael <[email protected]>
Date:   Wed Aug 13 10:50:04 2014 -0400

    ecore-wayland: Check return of calloc
    
    Calloc 'can' fail so lets check the return and make sure 'global' is
    valid else we will segfault.
    
    @fix
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index 4a634cd..5a21932 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -610,7 +610,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry 
*registry, unsigned in
 
    ewd = data;
 
-   global = calloc(1, sizeof(Ecore_Wl_Global));
+   if (!(global = calloc(1, sizeof(Ecore_Wl_Global)))) return;
 
    global->id = id;
    global->interface = strdup(interface);

-- 


Reply via email to