summaryrefslogtreecommitdiff
path: root/atspi/atspi-misc.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2021-02-22 12:31:15 -0600
committerMike Gorse <mgorse@suse.com>2021-02-22 12:31:15 -0600
commit40e972450fc5ce928914a380e32b33129033d4da (patch)
treec0ac06b182443d50e30d913cec68103f2ca37ae3 /atspi/atspi-misc.c
parent3c6b2c064b25e7b4e8b894168bc760febfd71795 (diff)
downloadat-spi2-core-40e972450fc5ce928914a380e32b33129033d4da.tar.gz
Fix an invalid free introduced in 2.39.90, along with some warnings
Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/30
Diffstat (limited to 'atspi/atspi-misc.c')
-rw-r--r--atspi/atspi-misc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index f897c7ea..7af46e9f 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -465,7 +465,8 @@ add_accessible_from_iter (DBusMessageIter *iter)
else
{
/* This place is already taken - let's free this place with dignity */
- g_object_unref (g_ptr_array_index (accessible->accessible_parent->children, index));
+ if (g_ptr_array_index (accessible->accessible_parent->children, index))
+ g_object_unref (g_ptr_array_index (accessible->accessible_parent->children, index));
}
g_ptr_array_index (accessible->accessible_parent->children, index) = g_object_ref (accessible);
}
@@ -1273,7 +1274,7 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name,
process_deferred_messages ();
if (!reply)
{
- // TODO: throw exception
+ /* TODO: throw exception */
goto done;
}
@@ -1300,14 +1301,12 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name,
}
if (!strcmp (type, "(so)"))
{
- g_object_unref (*(AtspiAccessible**)data);
*((AtspiAccessible **)data) = _atspi_dbus_return_accessible_from_iter (&iter_variant);
}
else
{
if (type [0] == 's')
{
- g_free (*(char**)data);
*(char**) data = NULL;
}