From: barbieri Date: Tue, 14 Jul 2009 14:00:59 +0000 (+0000) Subject: one more safety check: do not remove element if it's not in any list. X-Git-Tag: submit/2.0alpha-wayland/20121127.222009~1553 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7ed62fb928c3ba26ed78acf42f04dbb68851310;p=profile%2Fivi%2Feina.git one more safety check: do not remove element if it's not in any list. This is the best we can do, but what should be done is to check if element is really from that list. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@41326 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/eina_inlist.c b/src/lib/eina_inlist.c index c9fd58f..488b3e0 100644 --- a/src/lib/eina_inlist.c +++ b/src/lib/eina_inlist.c @@ -251,6 +251,8 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item) /* checkme */ EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(item, list); + EINA_SAFETY_ON_TRUE_RETURN_VAL + ((item != list) && (item->prev == NULL) && (item->next == NULL), list); if (item->next) item->next->prev = item->prev;