forked from enlightenment/efl
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:
parent
d2d831ddd3
commit
03747a7ef6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue