From a2c333a5b67df939b7c05bbf31063e098605b7b7 Mon Sep 17 00:00:00 2001 From: Thiep Ha Date: Thu, 27 Jun 2013 20:42:04 +0900 Subject: [PATCH] [CnP] Fix prevent of null dereference Change-Id: I97f25026f042a63b439304fb4a3e4185b543c9b4 --- src/lib/elm_cnp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c index 36099a7..ab2749b 100644 --- a/src/lib/elm_cnp.c +++ b/src/lib/elm_cnp.c @@ -2879,10 +2879,13 @@ elm_drop_item_container_add(Evas_Object *obj, if (elm_drop_item_container_del_internal(obj, EINA_FALSE)) { /* Updating info of existing obj */ st = eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj); + if (!st) return EINA_FALSE; } else { st = calloc(1, sizeof(*st)); + if (!st) return EINA_FALSE; + st->obj = obj; cont_drop_tg = eina_list_append(cont_drop_tg, st); } @@ -3224,10 +3227,13 @@ elm_drag_item_container_add( if (elm_drag_item_container_del_internal(obj, EINA_FALSE)) { /* Updating info of existing obj */ st = eina_list_search_unsorted(cont_drag_tg, _drag_item_container_cmp, obj); + if (!st) return EINA_FALSE; } else { st = calloc(1, sizeof(*st)); + if (!st) return EINA_FALSE; + st->obj = obj; cont_drag_tg = eina_list_append(cont_drag_tg, st); -- 2.7.4