Fixes use after free issue 96/282596/1
authorLukasz Oleksak <l.oleksak@samsung.com>
Thu, 6 Oct 2022 09:21:07 +0000 (11:21 +0200)
committerLukasz Oleksak <l.oleksak@samsung.com>
Thu, 6 Oct 2022 09:21:07 +0000 (11:21 +0200)
Change-Id: Ia5431d0677988dea20a6ae92b1e6250e4de62420

src/navigator.c

index 8fd1fe22983856aa1680d5ded8ef6b7b8de948b6..989db794b70e1d9e6091928675c58d6e4f234478 100644 (file)
@@ -822,7 +822,6 @@ TIZEN_PROD_STATIC void _cut_or_copy_selected_text(NavigatorData *nd, Eina_Bool i
 
        current_widget = _get_currently_controlled_accessible(nd->current_obj);
        text_interface = atspi_accessible_get_text_iface(current_widget);
-       g_object_unref(current_widget);
 
        if (text_interface) {
                text_selection_range = atspi_text_get_selection(text_interface, 0, &err);
@@ -859,6 +858,7 @@ TIZEN_PROD_STATIC void _cut_or_copy_selected_text(NavigatorData *nd, Eina_Bool i
                g_object_unref(text_interface);
        } else
                ERROR("Fail to get text interface");
+       g_object_unref(current_widget);
        return;
 }
 
@@ -876,7 +876,6 @@ TIZEN_PROD_STATIC void _paste_text(NavigatorData *nd)
 
        current_widget = _get_currently_controlled_accessible(nd->current_obj);
        text_interface = atspi_accessible_get_text_iface(current_widget);
-       g_object_unref(current_widget);
 
        if (text_interface) {
                text_selection_range = atspi_text_get_selection(text_interface, 0, &err);
@@ -930,7 +929,7 @@ TIZEN_PROD_STATIC void _paste_text(NavigatorData *nd)
                g_object_unref(text_interface);
        } else
                ERROR("Fail to get text interface");
-
+       g_object_unref(current_widget);
        return;
 }