[mutter/gnome-3-0] theme.c: Squash memory leak



commit 50d1b5326743f56b42e5d0dadb1b436a9012f95a
Author: Colin Walters <walters verbum org>
Date:   Thu May 5 16:46:00 2011 -0400

    theme.c: Squash memory leak
    
    When converting a token to a different type, we need to free its
    string.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649500

 src/ui/theme.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 0077388..9305645 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -2639,11 +2639,13 @@ meta_theme_replace_constants (MetaTheme   *theme,
         {
           if (meta_theme_lookup_int_constant (theme, t->d.v.name, &ival))
             {
+              g_free (t->d.v.name);
               t->type = POS_TOKEN_INT;
               t->d.i.val = ival;
             }
           else if (meta_theme_lookup_float_constant (theme, t->d.v.name, &dval))
             {
+              g_free (t->d.v.name);
               t->type = POS_TOKEN_DOUBLE;
               t->d.d.val = dval;
             }



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