From: Vivek Ellur Date: Thu, 22 Oct 2015 19:38:28 +0000 (-0700) Subject: elm_index: Fix memory leak issue in realloc failure X-Git-Tag: v1.16.0-beta3~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4492153c6ad360a97ab990f340ebf5be55218789;p=platform%2Fupstream%2Felementary.git elm_index: Fix memory leak issue in realloc failure Summary: @Fix Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3214 --- diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index 83194a7..7f3cb39 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -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);