summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-10-19 11:08:13 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-19 11:10:15 -0700
commit0054ea9514bb44a67ddaaabe4e0f213f8b3d934e (patch)
tree228f7eda8086be615c0ed8dcb488ba43b53d1dc7
parent49028c599a6fb2e42f8c199e08714da637e7f7fe (diff)
edje: fix memory leak on realloc.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3186 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/edje/edje_util.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 9a1b44630c..aa77208228 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5639,7 +5639,7 @@ _edje_program_remove(Edje_Part_Collection *edc, Edje_Program *p)
5639EAPI void 5639EAPI void
5640_edje_program_insert(Edje_Part_Collection *edc, Edje_Program *p) 5640_edje_program_insert(Edje_Part_Collection *edc, Edje_Program *p)
5641{ 5641{
5642 Edje_Program ***array; 5642 Edje_Program ***array, **temp;
5643 unsigned int *count; 5643 unsigned int *count;
5644 5644
5645 if (!p->signal && !p->source) 5645 if (!p->signal && !p->source)
@@ -5671,8 +5671,16 @@ _edje_program_insert(Edje_Part_Collection *edc, Edje_Program *p)
5671 count = &edc->programs.fnmatch_count; 5671 count = &edc->programs.fnmatch_count;
5672 } 5672 }
5673 5673
5674 temp = *array;
5674 *array = realloc(*array, sizeof (Edje_Program *) * (*count + 1)); 5675 *array = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
5675 (*array)[(*count)++] = p; 5676 if (*array)
5677 {
5678 (*array)[(*count)++] = p;
5679 }
5680 else
5681 {
5682 *array = temp;
5683 }
5676} 5684}
5677 5685
5678const char * 5686const char *