From 222b87d41baf19dc61de6febed366a6db2b847f0 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 15 Jun 2015 15:39:02 +0900 Subject: [PATCH] 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"); -- 2.7.4