From 519d4a3de509e2e5120630ae56c06ded2f329f81 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 8 Feb 2010 19:13:35 -0500 Subject: Fix a potential crasher in e_charset_add_radio_actions(). --- e-util/e-charset.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'e-util') diff --git a/e-util/e-charset.c b/e-util/e-charset.c index ffee5a8f4a..d2b7a91eeb 100644 --- a/e-util/e-charset.c +++ b/e-util/e-charset.c @@ -228,10 +228,12 @@ e_charset_add_radio_actions (GtkActionGroup *action_group, action = gtk_radio_action_new ( action_name, charset_label, NULL, NULL, def); - /* Character set name is static so no need to free it. */ - g_object_set_data ( + /* Character set name may NOT be static, + * so we do need to duplicate the string. */ + g_object_set_data_full ( G_OBJECT (action), "charset", - (gpointer) charset_name); + g_strdup (charset_name), + (GDestroyNotify) g_free); gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); -- cgit