aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_color_class.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2017-08-09 16:00:49 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2017-08-09 16:00:49 +0900
commit15bbf4712ee1e9356fa975de6f2861bc5ce3076a (patch)
tree1a9045c04db9dba665bac502771d165403b7936e /src/lib/elementary/elm_color_class.c
parentelm: Add missing undef EAPI to Elementary.h (diff)
downloadefl-15bbf4712ee1e9356fa975de6f2861bc5ce3076a.tar.gz
elm_color_class: add null checking after memory allocation
Diffstat (limited to 'src/lib/elementary/elm_color_class.c')
-rw-r--r--src/lib/elementary/elm_color_class.c6
1 files changed, 6 insertions, 0 deletions
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)