eunue pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=15bbf4712ee1e9356fa975de6f2861bc5ce3076a

commit 15bbf4712ee1e9356fa975de6f2861bc5ce3076a
Author: Jaeun Choi <jaeun12.c...@samsung.com>
Date:   Wed Aug 9 16:00:49 2017 +0900

    elm_color_class: add null checking after memory allocation
---
 src/lib/elementary/elm_color_class.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/elementary/elm_color_class.c 
b/src/lib/elementary/elm_color_class.c
index f88b8efbc5..9650022ba9 100644
--- a/src/lib/elementary/elm_color_class.c
+++ b/src/lib/elementary/elm_color_class.c
@@ -216,6 +216,8 @@ _colorclass_activate(void *data, const Efl_Event *event)
    else
      {
         cc->current = calloc(1, sizeof(Colorclass)); //actually 
Elm_Color_Overlay
+        if (!cc->current) return;
+
         memcpy(cc->current, ecc, sizeof(Elm_Color_Overlay));
         cc->current->name = eina_stringshare_ref(ecc->name);
      }
@@ -687,6 +689,8 @@ elm_color_class_editor_add(Evas_Object *obj)
              Colorclass *lcc;
 
              ecc2 = malloc(sizeof(Edje_Color_Class));
+             if (!ecc2) continue;
+
              memcpy(ecc2, ecc, sizeof(Edje_Color_Class));
              ecc2->name = eina_stringshare_add(ecc->name);
              if (tl_cb)
@@ -815,6 +819,8 @@ elm_color_class_util_edje_file_list(Eina_File *f)
    EINA_ITERATOR_FOREACH(it, ecc)
      {
         ecc2 = malloc(sizeof(Edje_Color_Class));
+        if (!ecc2) continue;
+
         memcpy(ecc2, ecc, sizeof(Edje_Color_Class));
         ecc2->name = eina_stringshare_add(ecc->name);
         if (tl_cb)

-- 


Reply via email to