summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-09-14 16:39:58 -0400
committerMike Gorse <mgorse@suse.com>2012-09-17 18:16:56 -0500
commit1b1fa3c23337e39eba5adfbf689302a9163d4c01 (patch)
treef19f0c6b3f767b4f784b718a2ec7bc1bd623f602
parentfa41c5f50c2850caa1b2236094c99186e4c5e462 (diff)
downloadat-spi2-atk-1b1fa3c23337e39eba5adfbf689302a9163d4c01.tar.gz
Don't leak strings
https://bugzilla.gnome.org/show_bug.cgi?id=684077
-rw-r--r--atk-adaptor/bridge.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index e3056e9..738c10b 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -249,7 +249,9 @@ register_reply (DBusPendingCall *pending, void *user_data)
dbus_message_iter_next (&iter_struct);
dbus_message_iter_get_basic (&iter_struct, &obj_path);
+ g_free (app->desktop_name);
app->desktop_name = g_strdup (app_name);
+ g_free (app->desktop_path);
app->desktop_path = g_strdup (obj_path);
}
}
@@ -275,8 +277,8 @@ register_application (SpiBridge * app)
/* These will be overridden when we get a reply, but in practice these
defaults should always be correct */
- app->desktop_name = ATSPI_DBUS_NAME_REGISTRY;
- app->desktop_path = ATSPI_DBUS_PATH_ROOT;
+ app->desktop_name = g_strdup (ATSPI_DBUS_NAME_REGISTRY);
+ app->desktop_path = g_strdup (ATSPI_DBUS_PATH_ROOT);
message = dbus_message_new_method_call (SPI_DBUS_NAME_REGISTRY,
ATSPI_DBUS_PATH_ROOT,
@@ -339,6 +341,11 @@ deregister_application (SpiBridge * app)
g_free (app->app_tmp_dir);
app->app_tmp_dir = NULL;
}
+
+ g_free (app->desktop_name);
+ app->desktop_name = NULL;
+ g_free (app->desktop_path);
+ app->desktop_path = NULL;
}
/*---------------------------------------------------------------------------*/