From 4c0928f324eee43fc01c866d536f0d9d5e070e6c Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Tue, 2 May 2017 10:53:56 +0530 Subject: [PATCH] sharing: Don't leak path g_file_get_path() allocates new memory for path. So using g_strdup() later would leak the previous allocation. https://bugzilla.gnome.org/show_bug.cgi?id=782045 --- panels/sharing/cc-sharing-panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 236be1c79..2e98194ff 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -553,7 +553,7 @@ cc_sharing_panel_new_media_sharing_row (const char *uri_or_path, G_CALLBACK (cc_sharing_panel_remove_folder), self); g_object_set_data (G_OBJECT (w), "row", row); - g_object_set_data_full (G_OBJECT (row), "path", g_strdup (path), g_free); + g_object_set_data_full (G_OBJECT (row), "path", path, g_free); gtk_widget_show_all (row);