raster pushed a commit to branch efl-1.22.

http://git.enlightenment.org/core/efl.git/commit/?id=fa40e25a02e1546a190e609eb5a3c9b3893dcc6d

commit fa40e25a02e1546a190e609eb5a3c9b3893dcc6d
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue Aug 20 15:16:04 2019 +0100

    elm theme - handle error cases and eina file handles properly
    
    @fix
---
 src/lib/elementary/elm_theme.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index 62397d1c09..2a6d52f6fc 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -60,7 +60,11 @@ _elm_theme_item_finalize(Eina_Inlist **files,
         char *version;
         int v;
 
-        if (!(version = edje_mmap_data_get(f, "version"))) return;
+        if (!(version = edje_mmap_data_get(f, "version")))
+          {
+             eina_file_close(f);
+             return;
+          }
         v = atoi(version);
         if (v < 110) // bump this version number when we need to
           {
@@ -702,11 +706,12 @@ elm_theme_extension_del(Elm_Theme *th, const char *item)
 EAPI void
 elm_theme_extension_mmap_add(Elm_Theme *th, const Eina_File *f)
 {
-   Eina_File *file = eina_file_dup(f);
+   Eina_File *file;
 
    if (!f) return;
    if (!th) th = theme_default;
    if (!th) return;
+   file = eina_file_dup(f);
    th->extension_items = eina_list_free(th->extension_items);
    _elm_theme_item_finalize(&th->extension, eina_file_filename_get(file), 
file, EINA_FALSE, EINA_FALSE);
    elm_theme_flush(th);

-- 


Reply via email to