evas vg: Check for OOM when setting root node in a vg canvas 14/189314/2
authorBryce Harrington <bryce@bryceharrington.org>
Fri, 14 Sep 2018 02:47:52 +0000 (11:47 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 18 Sep 2018 02:41:36 +0000 (02:41 +0000)
Change-Id: I7597f567be9579adcaedf3db113a66dbd773b211

src/lib/evas/canvas/efl_canvas_vg.c

index 9b2cb34..7cb9c64 100644 (file)
@@ -163,7 +163,14 @@ _efl_canvas_vg_root_node_set(Eo *obj, Efl_Canvas_Vg_Data *pd, Efl_VG *root_node)
    if (root_node)
      {
         if (!pd->user_entry)
-          pd->user_entry = malloc(sizeof(Vg_User_Entry));
+          {
+             pd->user_entry = malloc(sizeof(Vg_User_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;