raster pushed a commit to branch master.

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

commit 79228cd723f0a73da30dc7c01593988f579dd3ff
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 4f8b57e4e9..f3326b2f13 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
           {
@@ -706,11 +710,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