[gtk+] Avoid memory corruption in the color_properties hashtable.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Avoid memory corruption in the color_properties hashtable.
- Date: Sun, 5 Dec 2010 11:36:57 +0000 (UTC)
commit e0efd067e47e964bd60ad34ab331497867b49fd4
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Dec 5 12:30:28 2010 +0100
Avoid memory corruption in the color_properties hashtable.
gtk/gtkmodifierstyle.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index 48a4f21..2cbee61 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]