summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-09-30 14:59:24 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-09-30 15:13:47 -0700
commit6f550fec306b0585373615595c53e2b88e841571 (patch)
tree0dae82ae01ac73d9cc19d029a72b2cdd3d70727b
parent9fed51cf7932f311edbaeb9a10563e865c7ddd24 (diff)
downloadefl-6f550fec306b0585373615595c53e2b88e841571.tar.gz
edje: fix a memory leak while iterating used color class.
-rw-r--r--src/lib/edje/edje_util.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index c7913ecbac..589b644ced 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -780,12 +780,13 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
Edje_Refcount *er = NULL;
Eina_Iterator *ith;
Edje_Color_Class *cc;
+ Eina_Bool r = EINA_FALSE;
if (!eina_iterator_next(et->classes, (void **)&tuple)) return EINA_FALSE;
if (!tuple) return EINA_FALSE;
ith = eina_hash_iterator_data_new(tuple->data);
- if (!eina_iterator_next(ith, (void **)&er)) return EINA_FALSE;
+ if (!eina_iterator_next(ith, (void **)&er)) goto on_error;
/*
We actually need to ask on an object to get the correct value.
@@ -793,7 +794,7 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
This can some times not be the case, but for now we should be fine.
*/
cc = _edje_color_class_find(er->ed, tuple->key);
- if (!cc) return EINA_FALSE;
+ if (!cc) goto on_error;
et->cc = *cc;
/*
@@ -801,11 +802,15 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
description for this color class. Let's bet on that for now.
*/
cc = eina_hash_find(er->ed->file->color_hash, tuple->key);
- if (!cc) return EINA_FALSE;
+ if (!cc) goto on_error;
et->cc.desc = cc->desc;
*data = &et->cc;
- return EINA_TRUE;
+ r = EINA_TRUE;
+
+ on_error:
+ eina_iterator_free(ith);
+ return r;
}
static void *