diff --git a/lang/m2/comp/defmodule.c b/lang/m2/comp/defmodule.c index 400e47f62..4685360bf 100644 --- a/lang/m2/comp/defmodule.c +++ b/lang/m2/comp/defmodule.c @@ -115,6 +115,7 @@ GetDefinitionModule(id, incr) else { if (!is_anon_idf(id) && GetFile(id->id_text)) { + char *f = FileName; DefModule(); df = lookup(id, GlobalScope, D_IMPORTED, 0); if (level == 1 && @@ -135,6 +136,7 @@ GetDefinitionModule(id, incr) else Modules = n; nd_end = n; } + free(f); } else { df = lookup(id, GlobalScope, D_IMPORTED, 0); diff --git a/lang/m2/comp/program.g b/lang/m2/comp/program.g index 42dc9a827..96faf91e9 100644 --- a/lang/m2/comp/program.g +++ b/lang/m2/comp/program.g @@ -193,7 +193,6 @@ node_warning(exportlist, W_OLDFASHIONED, "export list in definition module ignor DefinitionModule--; match_id(dot.TOK_IDF, df->df_idf); df->df_flags &= ~D_BUSY; - free(FileName); } '.' ;