On Wed, 26 Aug 2009, Enlightenment SVN wrote:

Log:
 Don't calloc a toolbar item if elm_widget_data_get returns NULL.
 Slightly better trapping(s).


Author:       devilhorns
Date:         2009-08-26 07:34:55 -0700 (Wed, 26 Aug 2009)
New Revision: 42012

Modified:
 trunk/TMP/st/elementary/src/lib/elm_toolbar.c

Modified: trunk/TMP/st/elementary/src/lib/elm_toolbar.c
===================================================================
--- trunk/TMP/st/elementary/src/lib/elm_toolbar.c       2009-08-26 14:29:18 UTC 
(rev 42011)
+++ trunk/TMP/st/elementary/src/lib/elm_toolbar.c       2009-08-26 14:34:55 UTC 
(rev 42012)
@@ -265,9 +265,10 @@
{
   Widget_Data *wd = elm_widget_data_get(obj);
   Evas_Coord mw, mh;
-   Elm_Toolbar_Item *it = calloc(1, sizeof(Elm_Toolbar_Item));
+   Elm_Toolbar_Item *it;

-   if ((!it) || (!wd)) return NULL;
+   if (!wd) return NULL;
+   it = = calloc(1, sizeof(Elm_Toolbar_Item));

why don't you check if it is NULL or not ?

Vincent

   wd->items = eina_list_append(wd->items, it);
   it->obj = obj;
   it->label = eina_stringshare_add(label);
@@ -332,7 +333,7 @@
   Widget_Data *wd = elm_widget_data_get(it->obj);
   Evas_Object *obj2 = it->obj;

-   if (!wd) return;
+   if ((!wd) || (!it)) return;
   wd->items = eina_list_remove(wd->items, it);
   eina_stringshare_del(it->label);
   if (it->icon) evas_object_del(it->icon);


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-svn mailing list
enlightenment-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn

--
Ce message a été vérifié par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.
Message délivré par le serveur de messagerie de l'Université d'Evry.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to