This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enlightenment-module-forecasts.

View the commit online.

commit 8f19cd00b7b3b1bc0fb2124a07d949bd5c92fd64
Author: Carsten Haitzler (Rasterman) <[email protected]>
AuthorDate: Tue Mar 31 08:11:17 2026 +0100

    in the event of a error in parsing json - dont leak json root obj
    
    fix leak in case of error
    
    @fix
---
 src/e_mod_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index c0f3522..4b6bd1d 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -624,6 +624,7 @@ _forecasts_parse(void *data)
       "Fri",
       "Sat",
    };
+   json_object *o_root = NULL;
 
    if (!inst->buffer) return 0;
 
@@ -640,7 +641,7 @@ _forecasts_parse(void *data)
    result = eina_strbuf_string_get(inst->buffer);
    if (!result) goto error;
 
-   json_object *o_root = json_tokener_parse(result);
+   o_root = json_tokener_parse(result);
    if (!o_root) goto error;
    json_object *o_properties = json_object_object_get(o_root, "properties");
    if (!o_properties) goto error;
@@ -767,10 +768,11 @@ _forecasts_parse(void *data)
         days_prev = days;
      }
 
-   json_object_put(o_root);
+   if (o_root) json_object_put(o_root);
    return 1;
 
 error:
+   if (o_root) json_object_put(o_root);
    printf("FC: ERROR: Couldn't parse info\n");
    return 0;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to