mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 09:46:17 +01:00
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
This commit is contained in:
parent
4e7031f073
commit
fa58cef826
@ -1373,12 +1373,12 @@ _g_desktop_app_info_launch_uris_internal (GAppInfo *appinfo,
|
|||||||
* the connection if we were the initial owner.
|
* the connection if we were the initial owner.
|
||||||
*/
|
*/
|
||||||
g_dbus_connection_flush (session_bus, NULL, NULL, NULL);
|
g_dbus_connection_flush (session_bus, NULL, NULL, NULL);
|
||||||
g_object_unref (session_bus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
completed = TRUE;
|
completed = TRUE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
g_clear_object (&session_bus);
|
||||||
g_strfreev (argv);
|
g_strfreev (argv);
|
||||||
g_strfreev (envp);
|
g_strfreev (envp);
|
||||||
|
|
||||||
@ -2078,6 +2078,7 @@ g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
|
|||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
res = g_file_set_contents (filename, data, data_size, error);
|
res = g_file_set_contents (filename, data, data_size, error);
|
||||||
|
g_free (data);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
g_free (desktop_id);
|
g_free (desktop_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user