Remove unneeded code with notnull.cocci script
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Jul 2010 02:20:30 +0000 (02:20 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Jul 2010 02:20:30 +0000 (02:20 +0000)
This continues previous commit with more complex places, where it required
more than just removing some "ifs".

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@50242 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_rbtree.c

index 7ed4d19..ac3e738 100644 (file)
@@ -177,7 +177,7 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask)
    }
 
    it->stack = eina_array_new(8);
-   if (!it->stack) goto on_error;
+   if (!it->stack) goto on_error2;
 
    first = _eina_rbtree_iterator_list_new(root);
    if (!first) goto on_error;
@@ -193,9 +193,10 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask)
 
    return &it->iterator;
 
- on_error:
-   if (it && it->stack) eina_array_free(it->stack);
-   if (it) free(it);
+on_error:
+   eina_array_free(it->stack);
+on_error2:
+   free(it);
 
    return NULL;
 }