summaryrefslogtreecommitdiff
path: root/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'rule.c')
-rw-r--r--rule.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rule.c b/rule.c
index 08ab640..b813fa0 100644
--- a/rule.c
+++ b/rule.c
@@ -439,10 +439,23 @@ freerule (rule, lastrule)
{
struct rule *next = rule->next;
register unsigned int i;
+ register struct dep *dep;
for (i = 0; rule->targets[i] != 0; ++i)
free (rule->targets[i]);
+ dep = rule->deps;
+ while (dep)
+ {
+ struct dep *t;
+
+ t = dep->next;
+ /* We might leak dep->name here, but I'm not sure how to fix this: I
+ think that pointer might be shared (e.g., in the file hash?) */
+ free ((char *) dep);
+ dep = t;
+ }
+
free ((char *) rule->targets);
free ((char *) rule->suffixes);
free ((char *) rule->lens);