summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-10-22 12:38:28 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-22 12:40:19 -0700
commit4492153c6ad360a97ab990f340ebf5be55218789 (patch)
tree251febc541c823229096710d73a9882ccd9e3f7b
parenta10e9664c8a51e9d8d8997ab53ec7e76b9a26220 (diff)
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
-rw-r--r--src/lib/elm_index.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index 83194a779..7f3cb39e0 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -770,14 +770,17 @@ _sel_eval(Evas_Object *obj,
770 { 770 {
771 if (label && last) 771 if (label && last)
772 { 772 {
773 label = realloc(label, strlen(label) + 773 char *temp;
774
775 temp = realloc(label, strlen(label) +
774 strlen(last) + 1); 776 strlen(last) + 1);
775 if (!label) 777 if (!temp)
776 { 778 {
779 free(label);
777 free(last); 780 free(last);
778 return; 781 return;
779 } 782 }
780 strcat(label, last); 783 label = strcat(temp, last);
781 } 784 }
782 } 785 }
783 free(last); 786 free(last);