[at-spi2-core] Fix ref count leaks in atspi_accessible_get_application



commit cea1eb7d46cdfd7156616bf57ee36009e4401cf1
Author: Mike Gorse <mgorse suse com>
Date:   Mon Jan 14 17:16:38 2013 -0600

    Fix ref count leaks in atspi_accessible_get_application

 atspi/atspi-accessible.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 6732d1c..5f98199 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -799,6 +799,7 @@ atspi_accessible_get_application (AtspiAccessible *obj, GError **error)
       if (root)
       {
         g_object_unref (obj);
+        g_object_unref (parent);
         if (atspi_accessible_get_role (root, NULL) == ATSPI_ROLE_DESKTOP_FRAME)
         {
           g_object_unref (root);
@@ -809,7 +810,11 @@ atspi_accessible_get_application (AtspiAccessible *obj, GError **error)
     }
     if (!parent || parent == obj ||
         atspi_accessible_get_role (parent, NULL) == ATSPI_ROLE_DESKTOP_FRAME)
+  {
+    if (parent)
+      g_object_unref (parent);
     return obj;
+  }
     g_object_unref (obj);
     obj = parent;
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]