[gnome-control-center] sharing: Don't leak path
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sharing: Don't leak path
- Date: Tue, 2 May 2017 10:56:08 +0000 (UTC)
commit 4c0928f324eee43fc01c866d536f0d9d5e070e6c
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Tue May 2 10:53:56 2017 +0530
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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index 236be1c..2e98194 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]