From 749cc7478c6939edc53a36547d50b177a28c5263 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 14 Jul 2010 02:20:30 +0000 Subject: [PATCH] Remove unneeded code with notnull.cocci script This continues previous commit with more complex places, where it required more than just removing some "ifs". SVN revision: 50242 --- .../ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c | 2 +- legacy/eina/src/lib/eina_rbtree.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c b/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c index 3c8e1fda5c..f7e0d5a7ee 100644 --- a/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c +++ b/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c @@ -336,7 +336,7 @@ _ecore_config_ipc_ecore_init(const char *pipe_name, void **data) ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, _ecore_config_ipc_client_sent, server); - if (server) + if (*server) { INF("IPC/eCore: Server is listening on %s.", pipe_name); } diff --git a/legacy/eina/src/lib/eina_rbtree.c b/legacy/eina/src/lib/eina_rbtree.c index 7ed4d19924..ac3e7385a0 100644 --- a/legacy/eina/src/lib/eina_rbtree.c +++ b/legacy/eina/src/lib/eina_rbtree.c @@ -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; }