diff options
author | Paolo Borelli <pborelli@gnome.org> | 2010-12-05 12:30:28 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2010-12-05 12:30:28 +0100 |
commit | e0efd067e47e964bd60ad34ab331497867b49fd4 (patch) | |
tree | 7d48941197bbadc62f477a53fe63d001cb1288b9 /gtk/gtkmodifierstyle.c | |
parent | d351b40a0bd9ee247c5f64858c377378a1eccdbe (diff) | |
download | gtk+-e0efd067e47e964bd60ad34ab331497867b49fd4.tar.gz |
Avoid memory corruption in the color_properties hashtable.
Diffstat (limited to 'gtk/gtkmodifierstyle.c')
-rw-r--r-- | gtk/gtkmodifierstyle.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c index 48a4f21f6e..2cbee61b39 100644 --- a/gtk/gtkmodifierstyle.c +++ b/gtk/gtkmodifierstyle.c @@ -282,11 +282,15 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style, } if (color) - g_hash_table_insert (priv->color_properties, str, - gdk_rgba_copy (color)); + { + g_hash_table_insert (priv->color_properties, str, + gdk_rgba_copy (color)); + } else - g_hash_table_remove (priv->color_properties, str); + { + g_hash_table_remove (priv->color_properties, str); + g_free (str); + } g_signal_emit (style, signals[CHANGED], 0); - g_free (str); } |