summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2010-12-05 12:30:28 +0100
committerPaolo Borelli <pborelli@gnome.org>2010-12-05 12:30:28 +0100
commite0efd067e47e964bd60ad34ab331497867b49fd4 (patch)
tree7d48941197bbadc62f477a53fe63d001cb1288b9
parentd351b40a0bd9ee247c5f64858c377378a1eccdbe (diff)
downloadgtk+-e0efd067e47e964bd60ad34ab331497867b49fd4.tar.gz
Avoid memory corruption in the color_properties hashtable.
-rw-r--r--gtk/gtkmodifierstyle.c12
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);
}