[network-manager-applet/nma-1-0] libnma: copy the password_flags_name string for PopupMenuItemInfo



commit 5e4d2b523f1412a44daccced865f16c7b581913f
Author: Thomas Haller <thaller redhat com>
Date:   Fri Sep 11 12:29:32 2015 +0200

    libnma: copy the password_flags_name string for PopupMenuItemInfo
    
    (cherry picked from commit 1ba974dfcfd0d6e05de2fca857b9c537f5fed842)

 src/libnm-gtk/nm-ui-utils.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libnm-gtk/nm-ui-utils.c b/src/libnm-gtk/nm-ui-utils.c
index 5185e7c..a5d5c15 100644
--- a/src/libnm-gtk/nm-ui-utils.c
+++ b/src/libnm-gtk/nm-ui-utils.c
@@ -724,7 +724,7 @@ menu_item_to_secret_flags (MenuItem item)
 
 typedef struct {
        NMSetting *setting;
-       const char *password_flags_name;
+       char *password_flags_name;
        MenuItem item_number;
        GtkWidget *passwd_entry;
 } PopupMenuItemInfo;
@@ -736,6 +736,7 @@ popup_menu_item_info_destroy (gpointer data, GClosure *closure)
 
        if (info->setting)
                g_object_unref (info->setting);
+       g_clear_pointer (&info->password_flags_name, g_free);
        g_slice_free (PopupMenuItemInfo, info);
 }
 
@@ -770,7 +771,7 @@ popup_menu_item_info_register (GtkWidget *item,
 
        info = g_slice_new0 (PopupMenuItemInfo);
        info->setting = setting ? g_object_ref (setting) : NULL;
-       info->password_flags_name = password_flags_name;
+       info->password_flags_name = g_strdup (password_flags_name);
        info->item_number = item_number;
        info->passwd_entry = passwd_entry;
 


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