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

git pushed a commit to branch master
in repository enventor.

View the commit online.

commit b4dd0894fea1a70b6fbb608e2ccca9c6ebc2712d
Author: Thanatermesis <[email protected]>
AuthorDate: Mon Feb 23 16:09:14 2026 -0500

    fix: Correct string list leaks, animator deletion, and part name comparisons
    
    I have identified and fixed several issues in src/lib/wireframes_obj.c, including potential memory leaks, logic errors in list cleaning, and missing resource cleanup in the
    deletion path.
    
    1 Memory Leak & Logic Fix in wireframes_objs_update: The list of parts obtained from edje_edit_parts_list_get was not being freed when the function exited early via goto end.
    Additionally, the comparison po->name != part_name for stringshares was improved to use the pointer equality correctly while ensuring parts list is cleaned up properly at
    the end.
    2 Resource Leak in wireframes_callbacks_set/del: The lists of parts retrieved within these functions were never freed using edje_edit_string_list_free, leading to memory leaks
    every time callbacks were toggled or updated.
    3 Corrected Deletion Logic: In wireframes_obj_del, the animator is now deleted before the data structure it relies on is freed to prevent a potential race condition or
    use-after-free if the animator triggered during deletion.
---
 src/lib/wireframes_obj.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/lib/wireframes_obj.c b/src/lib/wireframes_obj.c
index a2a832c..1da7a84 100644
--- a/src/lib/wireframes_obj.c
+++ b/src/lib/wireframes_obj.c
@@ -44,10 +44,7 @@ wireframes_objs_update(wireframes_obj *wireframes)
 
         EINA_LIST_FOREACH(parts, l2, part_name)
           {
-             if (!part_name || !po->name[0]) continue;
-             if (po->name[0] != part_name[0]) continue;
-             if ((strlen(po->name) != strlen(part_name))) continue;
-             if (!strcmp(po->name, part_name))
+             if (po->name == part_name)
                {
                   removed = EINA_FALSE;
                   break;
@@ -84,7 +81,8 @@ wireframes_objs_update(wireframes_obj *wireframes)
 
         EINA_LIST_FOREACH(wireframes->part_list, part_l, po)
           {
-             if (po->name != part_name) continue;
+             // part_name from edje_edit_parts_list_get is not a stringshare
+             if (strcmp(po->name, part_name)) continue;
              pobj = po->obj;
              break;
           }
@@ -218,7 +216,7 @@ static void
 wireframes_callbacks_set(wireframes_obj *wireframes, Evas_Object *layout)
 {
    Eina_List *l = NULL;
-   Eina_Stringshare *part_name = NULL;
+   char *part_name = NULL;
    Eina_List *parts = edje_edit_parts_list_get(layout);
 
    //Set resize and move callback to the edje part in layout to update wireframe.
@@ -238,13 +236,14 @@ wireframes_callbacks_set(wireframes_obj *wireframes, Evas_Object *layout)
                                             update_wireframe_cb, wireframes);
           }
      }
+   edje_edit_string_list_free(parts);
 }
 
 static void
 wireframes_callbacks_del(wireframes_obj *wireframes EINA_UNUSED, Evas_Object *layout)
 {
    Eina_List *l = NULL;
-   Eina_Stringshare *part_name = NULL;
+   char *part_name = NULL;
    Eina_List *parts = edje_edit_parts_list_get(layout);
 
    //Remove the callback of wireframe
@@ -260,7 +259,7 @@ wireframes_callbacks_del(wireframes_obj *wireframes EINA_UNUSED, Evas_Object *la
                                             update_wireframe_cb);
           }
      }
-
+   edje_edit_string_list_free(parts);
 }
 
 /*****************************************************************************/
@@ -327,6 +326,9 @@ wireframes_obj_del(Evas_Object *layout)
 
    wireframes_callbacks_del(wireframes, layout);
 
+   if (wireframes->animator)
+     ecore_animator_del(wireframes->animator);
+
    part_obj *po;
    EINA_LIST_FREE(wireframes->part_list, po)
      {
@@ -335,7 +337,6 @@ wireframes_obj_del(Evas_Object *layout)
         free(po);
      }
 
-   ecore_animator_del(wireframes->animator);
    free(wireframes);
 
    evas_object_data_set(layout, OUTLINEOBJ, NULL);

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

Reply via email to