diff options
author | Thiep Ha <thiep.ha@samsung.com> | 2015-06-11 09:46:36 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2015-06-11 09:50:12 +0100 |
commit | ac09acd5080df05c4f3049b30bbc656c9dc21f39 (patch) | |
tree | 2d54d2c486b2a8e0d4d6ccbb693093dd61f17352 /src | |
parent | 26b27319b42baa40acda3acbccdfedeed4dad838 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/eo/Eo.h | 4 |
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 * | |||
180 | EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name) | 180 | EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name) |
181 | { | 181 | { |
182 | Eo_Dbg_Info *tmp = (Eo_Dbg_Info *)calloc(1, sizeof(*tmp)); | 182 | Eo_Dbg_Info *tmp = (Eo_Dbg_Info *)calloc(1, sizeof(*tmp)); |
183 | |||
184 | if (!tmp) return NULL; | ||
183 | tmp->name = eina_stringshare_add(name); | 185 | tmp->name = eina_stringshare_add(name); |
184 | eina_value_list_setup(&(tmp->value), EO_DBG_INFO_TYPE); | 186 | eina_value_list_setup(&(tmp->value), EO_DBG_INFO_TYPE); |
185 | if (list) | 187 | if (list) |
@@ -203,6 +205,8 @@ do { \ | |||
203 | if (List) \ | 205 | if (List) \ |
204 | { \ | 206 | { \ |
205 | Eo_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \ | 207 | Eo_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \ |
208 | \ | ||
209 | if (!Tmp) break; \ | ||
206 | Tmp->name = eina_stringshare_add(NAME); \ | 210 | Tmp->name = eina_stringshare_add(NAME); \ |
207 | eina_value_setup(&(Tmp->value), TYPE); \ | 211 | eina_value_setup(&(Tmp->value), TYPE); \ |
208 | eina_value_set(&(Tmp->value), VALUE); \ | 212 | eina_value_set(&(Tmp->value), VALUE); \ |