Edje entry: Make cursors to null after free
authorSubodh Kumar <s7158.kumar@samsung.com>
Fri, 25 Sep 2015 08:49:18 +0000 (09:49 +0100)
committerTom Hacohen <tom@stosb.com>
Fri, 25 Sep 2015 08:49:18 +0000 (09:49 +0100)
Summary:
Edje entry: Make cursors to null after free

To prevent any illegal access of cursors
can lead to crash

@fix

Test Plan: NA

Reviewers: tasn

Reviewed By: tasn

Subscribers: shilpasingh, cedric

Differential Revision: https://phab.enlightenment.org/D3093

src/lib/edje/edje_entry.c

index e32a52e..b6cbf84 100644 (file)
@@ -1100,8 +1100,6 @@ _anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED,
      {
         Anchor *an = en->anchors->data;
 
-        evas_textblock_cursor_free(an->start);
-        evas_textblock_cursor_free(an->end);
         while (an->sel)
           {
              Sel *sel = an->sel->data;
@@ -1111,6 +1109,8 @@ _anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED,
              free(sel);
              an->sel = eina_list_remove_list(an->sel, an->sel);
           }
+        evas_textblock_cursor_free(an->start);
+        evas_textblock_cursor_free(an->end);
         free(an->name);
         free(an);
         en->anchors = eina_list_remove_list(en->anchors, en->anchors);