symbol.c (free_entry_list): New function.
authorMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 15:25:51 +0000 (15:25 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 15:25:51 +0000 (15:25 +0000)
2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>

* symbol.c (free_entry_list): New function.
(gfc_free_namespace): Free list of entries.

From-SVN: r165038

gcc/fortran/ChangeLog
gcc/fortran/symbol.c

index 97df7a5b48e77d87f6c12871368f572527bf0111..80b013f7c7476080a88edac7102488b88c10809e 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * symbol.c (free_entry_list): New function.
+       (gfc_free_namespace): Free list of entries.
+
 2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
 
        * symbol.c (free_components): Free list of formal args and formal
index b06afe44f3cb2c2ab9497ac993cdf368c626610d..b900bc197256aa4c47e91bc7ee29c95b310dc71d 100644 (file)
@@ -3255,6 +3255,22 @@ void gfc_free_charlen (gfc_charlen *cl, gfc_charlen *end)
 }
 
 
+/* Free entry list structs.  */
+
+static void
+free_entry_list (gfc_entry_list *el)
+{
+  gfc_entry_list *next;
+
+  if (el == NULL)
+    return;
+
+  next = el->next;
+  gfc_free (el);
+  free_entry_list (next);
+}
+
+
 /* Free a namespace structure and everything below it.  Interface
    lists associated with intrinsic operators are not freed.  These are
    taken care of when a specific name is freed.  */
@@ -3284,6 +3300,7 @@ gfc_free_namespace (gfc_namespace *ns)
   gfc_free_charlen (ns->cl_list, NULL);
   free_st_labels (ns->st_labels);
 
+  free_entry_list (ns->entries);
   gfc_free_equiv (ns->equiv);
   gfc_free_equiv_lists (ns->equiv_lists);
   gfc_free_use_stmts (ns->use_stmts);