]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
g-i: Fix use after free in scanner
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 20 Sep 2018 08:57:43 +0000 (10:57 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 20 Sep 2018 08:57:43 +0000 (10:57 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/674

gobject-introspection/scannerparser.y

index 47a97b60193b6646b3f3272901f9802d6bbe51fb..2042bdc56259e8823b77214e5eba8be2294b1b60 100644 (file)
@@ -54,10 +54,10 @@ csymbol_new (CSymbolType type)
 static void
 ctype_free (CType * type)
 {
-  g_free (type);
   g_free (type->name);
   g_list_foreach (type->child_list, (GFunc)ctype_free, NULL);
   g_list_free (type->child_list);
+  g_free (type);
 }
 
 void
@@ -66,9 +66,9 @@ csymbol_free (CSymbol * symbol)
   g_free (symbol->ident);
   ctype_free (symbol->base_type);
   g_free (symbol->const_string);
-  g_free (symbol);
   g_slist_foreach (symbol->directives, (GFunc)cdirective_free, NULL);
   g_slist_free (symbol->directives);
+  g_free (symbol);
 }
  
 gboolean