From f2cfe32e0306db54e0d37626cd489a5e035705eb Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 18 Jan 1993 16:14:43 +0000 Subject: [PATCH] found some small leaks with Purify --- lang/m2/comp/input.c | 1 + lang/m2/comp/options.c | 3 ++- lang/m2/comp/program.g | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/m2/comp/input.c b/lang/m2/comp/input.c index 92183b3fb..6d7197d4e 100644 --- a/lang/m2/comp/input.c +++ b/lang/m2/comp/input.c @@ -20,6 +20,7 @@ AtEoIF() /* Make the unstacking of input streams noticable to the lexical analyzer */ + if (WorkingDir[0] != '\0') free(WorkingDir); return 1; } diff --git a/lang/m2/comp/options.c b/lang/m2/comp/options.c index 370aa652e..9f63bea20 100644 --- a/lang/m2/comp/options.c +++ b/lang/m2/comp/options.c @@ -138,7 +138,7 @@ DoOption(text) register int i; register char *new = text; - if (++nDEF > mDEF) { + if (nDEF > mDEF) { DEFPATH = (char **) Realloc((char *)DEFPATH,(unsigned)(mDEF+=10)*sizeof(char *)); } @@ -149,6 +149,7 @@ DoOption(text) DEFPATH[i] = new; new = tmp; } + ++nDEF; } else DEFPATH[ndirs] = 0; break; diff --git a/lang/m2/comp/program.g b/lang/m2/comp/program.g index 96faf91e9..42dc9a827 100644 --- a/lang/m2/comp/program.g +++ b/lang/m2/comp/program.g @@ -193,6 +193,7 @@ 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); } '.' ;