summaryrefslogtreecommitdiff
path: root/gio/gdesktopappinfo.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-08-24 17:06:46 -0400
committerDan Winship <danw@gnome.org>2012-09-03 08:36:10 -0400
commitfa58cef826d8f3b6b3eb0cad230b0421ee35f8a2 (patch)
tree6ae40dd8ea4d390d8266a65650e3eeb8afdf8ca0 /gio/gdesktopappinfo.c
parent4e7031f073db2df7297feab35c9d353b0b3977d8 (diff)
GDesktopAppInfo: fix leaks
g_desktop_app_info_ensure_saved() was leaking the file contents. _g_desktop_app_info_launch_uris_internal() was leaking the session bus on error. https://bugzilla.gnome.org/show_bug.cgi?id=682560
Diffstat (limited to 'gio/gdesktopappinfo.c')
-rw-r--r--gio/gdesktopappinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index cde2d4a43..1bac191af 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -1373,12 +1373,12 @@ _g_desktop_app_info_launch_uris_internal (GAppInfo *appinfo,
* the connection if we were the initial owner.
*/
g_dbus_connection_flush (session_bus, NULL, NULL, NULL);
- g_object_unref (session_bus);
}
completed = TRUE;
out:
+ g_clear_object (&session_bus);
g_strfreev (argv);
g_strfreev (envp);
@@ -2078,6 +2078,7 @@ g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
close (fd);
res = g_file_set_contents (filename, data, data_size, error);
+ g_free (data);
if (!res)
{
g_free (desktop_id);