diff options
author | Mike Gorse <mgorse@suse.com> | 2021-02-22 15:53:35 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2021-02-22 15:53:35 -0600 |
commit | edc59b4d0fbc37cd7763109167f50f42bb50edca (patch) | |
tree | 4806e851db583678ef75d99c16c349d082958887 /atspi/atspi-accessible.c | |
parent | bf42baac000c08a2c943a373c499f36846bed61f (diff) | |
download | at-spi2-core-edc59b4d0fbc37cd7763109167f50f42bb50edca.tar.gz |
atspi_accessible_get_(name|description): fix memory leak
This is likely what the backed-out part of !53 was trying to do.
Diffstat (limited to 'atspi/atspi-accessible.c')
-rw-r--r-- | atspi/atspi-accessible.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index b078688c..ab1267aa 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -340,8 +340,12 @@ gchar * atspi_accessible_get_name (AtspiAccessible *obj, GError **error) { g_return_val_if_fail (obj != NULL, g_strdup ("")); + if (!_atspi_accessible_test_cache (obj, ATSPI_CACHE_NAME)) { +if (obj->name) printf("free\n"); + g_free (obj->name); + obj->name = NULL; if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, "Name", error, "s", &obj->name)) return g_strdup (""); @@ -366,6 +370,8 @@ atspi_accessible_get_description (AtspiAccessible *obj, GError **error) if (!_atspi_accessible_test_cache (obj, ATSPI_CACHE_DESCRIPTION)) { + g_free (obj->description); + obj->description = NULL; if (!_atspi_dbus_get_property (obj, atspi_interface_accessible, "Description", error, "s", &obj->description)) |