[gtk+/wip/css: 7/37] cssparser: Don't use a free'd string in error messages



commit 9b00012f0db9be3d4df0670addc76524edc6017c
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 19 17:01:37 2012 +0200

    cssparser: Don't use a free'd string in error messages

 gtk/gtkcssparser.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c
index bedfdec..04242aa 100644
--- a/gtk/gtkcssparser.c
+++ b/gtk/gtkcssparser.c
@@ -669,15 +669,16 @@ _gtk_css_number_value_parse (GtkCssParser           *parser,
             break;
         }
 
-      g_free (unit_name);
-
       if (i >= G_N_ELEMENTS (units))
         {
           _gtk_css_parser_error (parser, "`%s' is not a valid unit.", unit_name);
+          g_free (unit_name);
           return NULL;
         }
 
       unit = units[i].unit;
+
+      g_free (unit_name);
     }
   else
     {



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