[gtk+/nth-child: 24/33] cssprovider: Don't use memdup() for sliced memory



commit 0b28e7be38fd3779242cd52dc02c255d3f1e6f3a
Author: Benjamin Otte <otte redhat com>
Date:   Fri May 27 22:42:53 2011 +0200

    cssprovider: Don't use memdup() for sliced memory

 gtk/gtkcssprovider.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 3bd7c5f..13d39fd 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1088,7 +1088,8 @@ gtk_css_ruleset_add (GtkCssRuleset          *ruleset,
           GValue *value;
           
           child = _gtk_style_property_lookup (parameters[i].name);
-          value = g_memdup (&parameters[i].value, sizeof (GValue));
+          value = g_slice_new (GValue);
+          memcpy (value, &parameters[i].value, sizeof (GValue));
           gtk_css_ruleset_add (ruleset, child, value);
         }
       g_free (parameters);



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