jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=222b87d41baf19dc61de6febed366a6db2b847f0

commit 222b87d41baf19dc61de6febed366a6db2b847f0
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Mon Jun 15 15:39:02 2015 +0900

    layout: Add NULL check for calloc memory allocation.
---
 src/lib/elm_layout.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 2dc2567..9b60e4b 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -1612,6 +1612,11 @@ _elm_layout_part_cursor_set(Eo *obj, 
Elm_Layout_Smart_Data *sd, const char *part
    else
      {
         pc = calloc(1, sizeof(*pc));
+        if (!pc)
+          {
+             ERR("failed to allocate memory!");
+             return EINA_FALSE;
+          }
         pc->part = eina_stringshare_add(part_name);
         pc->cursor = eina_stringshare_add(cursor);
         pc->style = eina_stringshare_add("default");

-- 


Reply via email to