forked from enlightenment/efl
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>
This commit is contained in:
parent
49028c599a
commit
0054ea9514
|
@ -5639,7 +5639,7 @@ _edje_program_remove(Edje_Part_Collection *edc, Edje_Program *p)
|
|||
EAPI void
|
||||
_edje_program_insert(Edje_Part_Collection *edc, Edje_Program *p)
|
||||
{
|
||||
Edje_Program ***array;
|
||||
Edje_Program ***array, **temp;
|
||||
unsigned int *count;
|
||||
|
||||
if (!p->signal && !p->source)
|
||||
|
@ -5671,9 +5671,17 @@ _edje_program_insert(Edje_Part_Collection *edc, Edje_Program *p)
|
|||
count = &edc->programs.fnmatch_count;
|
||||
}
|
||||
|
||||
temp = *array;
|
||||
*array = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
|
||||
if (*array)
|
||||
{
|
||||
(*array)[(*count)++] = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
*array = temp;
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
edje_string_get(const Edje_String *es)
|
||||
|
|
Loading…
Reference in New Issue