summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-10-22 12:38:28 -0700
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit614acd16dcb8cceb6c147e5ee6ee442e8b48697d (patch)
tree251febc541c823229096710d73a9882ccd9e3f7b
parent15426c27fb75e85f20210f11cdb6b518f55157c0 (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);