summaryrefslogtreecommitdiff
path: root/src
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:12:48 -0700
commit8e034a8c44f10815e6e9b9d3bfca902cc668ef7c (patch)
tree5eaf636b26c3e71f0c43452a75370d0dbaea97a8 /src
parent1e18cf7057824051dda8b905690eca4a67d11da7 (diff)
edje: fix a memory leak while iterating used color class.
Diffstat (limited to 'src')
-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 c238c13685..9a1b44630c 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -781,12 +781,13 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
781 Edje_Refcount *er = NULL; 781 Edje_Refcount *er = NULL;
782 Eina_Iterator *ith; 782 Eina_Iterator *ith;
783 Edje_Color_Class *cc; 783 Edje_Color_Class *cc;
784 Eina_Bool r = EINA_FALSE;
784 785
785 if (!eina_iterator_next(et->classes, (void **)&tuple)) return EINA_FALSE; 786 if (!eina_iterator_next(et->classes, (void **)&tuple)) return EINA_FALSE;
786 if (!tuple) return EINA_FALSE; 787 if (!tuple) return EINA_FALSE;
787 788
788 ith = eina_hash_iterator_data_new(tuple->data); 789 ith = eina_hash_iterator_data_new(tuple->data);
789 if (!eina_iterator_next(ith, (void **)&er)) return EINA_FALSE; 790 if (!eina_iterator_next(ith, (void **)&er)) goto on_error;
790 791
791 /* 792 /*
792 We actually need to ask on an object to get the correct value. 793 We actually need to ask on an object to get the correct value.
@@ -794,7 +795,7 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
794 This can some times not be the case, but for now we should be fine. 795 This can some times not be the case, but for now we should be fine.
795 */ 796 */
796 cc = _edje_color_class_find(er->ed, tuple->key); 797 cc = _edje_color_class_find(er->ed, tuple->key);
797 if (!cc) return EINA_FALSE; 798 if (!cc) goto on_error;
798 et->cc = *cc; 799 et->cc = *cc;
799 800
800 /* 801 /*
@@ -802,11 +803,15 @@ _edje_color_class_active_iterator_next(Eina_Iterator *it, void **data)
802 description for this color class. Let's bet on that for now. 803 description for this color class. Let's bet on that for now.
803 */ 804 */
804 cc = eina_hash_find(er->ed->file->color_hash, tuple->key); 805 cc = eina_hash_find(er->ed->file->color_hash, tuple->key);
805 if (!cc) return EINA_FALSE; 806 if (!cc) goto on_error;
806 et->cc.desc = cc->desc; 807 et->cc.desc = cc->desc;
807 808
808 *data = &et->cc; 809 *data = &et->cc;
809 return EINA_TRUE; 810 r = EINA_TRUE;
811
812 on_error:
813 eina_iterator_free(ith);
814 return r;
810} 815}
811 816
812static void * 817static void *