elm_index: Fix memory leak issue in realloc failure

Summary:
@Fix

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3214
This commit is contained in:
Vivek Ellur 2015-10-22 12:38:28 -07:00 committed by Cedric BAIL
parent d2d831ddd3
commit 03747a7ef6
1 changed files with 6 additions and 3 deletions

View File

@ -770,14 +770,17 @@ _sel_eval(Evas_Object *obj,
{
if (label && last)
{
label = realloc(label, strlen(label) +
char *temp;
temp = realloc(label, strlen(label) +
strlen(last) + 1);
if (!label)
if (!temp)
{
free(label);
free(last);
return;
}
strcat(label, last);
label = strcat(temp, last);
}
}
free(last);