elm_index: Also free last on error path.
authorStefan Schmidt <s.schmidt@samsung.com>
Tue, 17 Jun 2014 09:12:04 +0000 (11:12 +0200)
committerStefan Schmidt <s.schmidt@samsung.com>
Tue, 17 Jun 2014 09:12:04 +0000 (11:12 +0200)
If we can't realloc label we need to free last before we can return
or we leak it.

CID: 1193240

src/lib/elm_index.c

index 62c2cc1..cf66fe0 100644 (file)
@@ -652,7 +652,11 @@ _sel_eval(Evas_Object *obj,
                          {
                             label = realloc(label, strlen(label) +
                                             strlen(last) + 1);
-                            if (!label) return;
+                            if (!label)
+                              {
+                                 free(last);
+                                 return;
+                              }
                             strcat(label, last);
                          }
                     }