eolian: memory leak fix
authorDaniel Kolesa <d.kolesa@samsung.com>
Tue, 22 Jul 2014 09:15:56 +0000 (10:15 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 22 Jul 2014 09:15:56 +0000 (10:15 +0100)
src/lib/eolian/eo_parser.c

index 597ea9cac723e394830d9e356e488876d20b87a1..5d892c97a1283e023826326cd638f1c3b9c364da 100644 (file)
@@ -126,9 +126,11 @@ append_node(Eo_Lexer *ls, int type, void *def)
 static const char *
 get_filename(Eo_Lexer *ls)
 {
-   Eina_Array *arr = eina_file_split(strdup(ls->source));
+   char *s = strdup(ls->source);
+   Eina_Array *arr = eina_file_split(s);
    const char *file = eina_stringshare_add(eina_array_data_get(arr,
                                            eina_array_count_get(arr) - 1));
+   free(s);
    eina_array_free(arr);
    return file;
 }