layout: Add NULL check for calloc memory allocation.

This commit is contained in:
Jaehyun Cho 2015-06-15 15:39:02 +09:00
parent a67e7e39ef
commit 9e1968823d
1 changed files with 5 additions and 0 deletions

View File

@ -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");