hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3f957a9bd0f46c0f0771b3ebddcae4462e56e050

commit 3f957a9bd0f46c0f0771b3ebddcae4462e56e050
Author: Bryce Harrington <[email protected]>
Date:   Fri Sep 14 11:47:52 2018 +0900

    evas vg: Check for OOM when setting root node in a vg canvas
---
 src/lib/evas/canvas/efl_canvas_vg_object.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c 
b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 040d2e82cb..c476b0eb58 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -160,8 +160,14 @@ _efl_canvas_vg_object_root_node_set(Eo *obj, 
Efl_Canvas_Vg_Object_Data *pd, Efl_
    if (root_node)
      {
         if (!pd->user_entry)
-          pd->user_entry = malloc(sizeof(User_Vg_Entry));
-
+          {
+             pd->user_entry = malloc(sizeof(User_Vg_Entry));
+             if (!pd->user_entry)
+               {
+                  ERR("Failed to alloc user entry data while setting root 
node");
+                  return;
+               }
+          }
         pd->user_entry->w = pd->user_entry->h = 0;
         pd->user_entry->root = root_node;
 

-- 


Reply via email to