aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiep Ha <thiep.ha@samsung.com>2015-06-11 09:46:36 +0100
committerTom Hacohen <tom@stosb.com>2015-06-11 09:50:12 +0100
commitac09acd5080df05c4f3049b30bbc656c9dc21f39 (patch)
tree2d54d2c486b2a8e0d4d6ccbb693093dd61f17352
parentedje: add po file support in edc translation. (diff)
downloadefl-ac09acd5080df05c4f3049b30bbc656c9dc21f39.tar.gz
Eo: Add Null check
Summary: Add Null checking when allocate memory. Reviewers: cedric, tasn Reviewed By: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2664
-rw-r--r--src/lib/eo/Eo.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 02a5520a09..b9ef08277c 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -180,6 +180,8 @@ static inline Eo_Dbg_Info *
EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name)
{
Eo_Dbg_Info *tmp = (Eo_Dbg_Info *)calloc(1, sizeof(*tmp));
+
+ if (!tmp) return NULL;
tmp->name = eina_stringshare_add(name);
eina_value_list_setup(&(tmp->value), EO_DBG_INFO_TYPE);
if (list)
@@ -203,6 +205,8 @@ do { \
if (List) \
{ \
Eo_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \
+ \
+ if (!Tmp) break; \
Tmp->name = eina_stringshare_add(NAME); \
eina_value_setup(&(Tmp->value), TYPE); \
eina_value_set(&(Tmp->value), VALUE); \