summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-02-14 15:42:17 +0000
committerPaul Smith <psmith@gnu.org>2006-02-14 15:42:17 +0000
commit86af3872a910e314d20ef911fad1819ad90c1291 (patch)
treeca807059149cdac8be7461efa747b41505b36513 /implicit.c
parentdf267b31c5dbe4d9fe774c63acc31ef0b804f902 (diff)
downloadgunmake-86af3872a910e314d20ef911fad1819ad90c1291.tar.gz
Some memory leak cleanups (found with valgrind).
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/implicit.c b/implicit.c
index 7b34fba..d7c140a 100644
--- a/implicit.c
+++ b/implicit.c
@@ -77,24 +77,25 @@ struct idep
};
static void
-free_idep_chain (struct idep* p)
+free_idep_chain (struct idep *p)
{
- register struct idep* n;
- register struct file *f;
+ struct idep *n;
+ struct file *f;
for (; p != 0; p = n)
{
n = p->next;
if (p->name)
- {
- free (p->name);
-
- f = p->intermediate_file;
+ free (p->name);
- if (f != 0
- && (f->stem < f->name
- || f->stem > f->name + strlen (f->name)))
+ f = p->intermediate_file;
+ if (f != 0)
+ {
+ /* if (f->variables)
+ free_variable_set (f->variables); */
+ if (f->stem < f->name
+ || f->stem > f->name + strlen (f->name))
free (f->stem);
}
@@ -742,6 +743,8 @@ pattern_search (struct file *file, int archive,
/* If we have tried to find P as an intermediate
file and failed, mark that name as impossible
so we won't go through the search again later. */
+ if (intermediate_file->variables)
+ free_variable_set (intermediate_file->variables);
file_impossible (name);
}