From patchwork Tue Oct 5 10:11:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [fortran,12/22] Various minor fixups Date: Tue, 05 Oct 2010 00:11:11 -0000 From: Mikael Morin X-Patchwork-Id: 66802 Message-Id: <20101005100948.1836.16710@gimli.local> To: gfortran , patches 2010-10-04 Mikael Morin * symbol.c (free_entry_list): New function. (gfc_free_namespace): Free list of entries. diff --git a/symbol.c b/symbol.c index cd07b63..1f41031 100644 --- a/symbol.c +++ b/symbol.c @@ -3252,6 +3252,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. */ @@ -3281,6 +3297,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);