[gnome-control-center/iainl/privacy-panel-disconnect-settings-signal-properly: 2/2] privacy: Don't strdup keys when connecting the label cb



commit e97337519f5913fb9a94f9cbfec3ae65e9f7defe
Author: Iain Lane <iainl gnome org>
Date:   Tue Feb 19 08:53:53 2019 +0000

    privacy: Don't strdup keys when connecting the label cb
    
    These are const char *s, we don't need this. Without this we leak them.

 panels/privacy/cc-privacy-panel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/privacy/cc-privacy-panel.c b/panels/privacy/cc-privacy-panel.c
index f2ccdc0b0..bff97c1a0 100644
--- a/panels/privacy/cc-privacy-panel.c
+++ b/panels/privacy/cc-privacy-panel.c
@@ -288,8 +288,8 @@ get_on_off_label2 (GSettings *settings,
 
   data = g_new (Label2Data, 1);
   data->label = GTK_LABEL (gtk_label_new (""));
-  data->key1 = g_strdup (key1);
-  data->key2 = g_strdup (key2);
+  data->key1 = key1;
+  data->key2 = key2;
 
   g_signal_connect_object (settings,
                            "changed",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]