[libdazzle/libdazzle-3-26] shortcuts: contexts hashtable expects interned string



commit 501f43e65f4e7cd88665555802cb209d764ee5d5
Author: Christian Hergert <chergert redhat com>
Date:   Wed Dec 13 21:54:58 2017 -0800

    shortcuts: contexts hashtable expects interned string
    
    This was both a leak and incorrect because we use the pointer as
    the hash key in the hashtable.

 src/shortcuts/dzl-shortcut-theme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-theme.c b/src/shortcuts/dzl-shortcut-theme.c
index f32ac0b..3f40057 100644
--- a/src/shortcuts/dzl-shortcut-theme.c
+++ b/src/shortcuts/dzl-shortcut-theme.c
@@ -352,7 +352,7 @@ dzl_shortcut_theme_add_context (DzlShortcutTheme   *self,
 
   g_return_if_fail (name != NULL);
 
-  g_hash_table_insert (priv->contexts, g_strdup (name), g_object_ref (context));
+  g_hash_table_insert (priv->contexts, (gchar *)g_intern_string (name), g_object_ref (context));
 }
 
 DzlShortcutTheme *


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