diff options
author | Paul Smith <psmith@gnu.org> | 1999-07-20 22:34:41 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-07-20 22:34:41 +0000 |
commit | 73846549f62b832ca6ff761ad3640a86d3b32c86 (patch) | |
tree | 040672d69082d86fe744ca7157bee5b72147f511 /rule.c | |
parent | 169e6b8c3de0145c61ff2127b7c191d12f069d2b (diff) | |
download | gunmake-73846549f62b832ca6ff761ad3640a86d3b32c86.tar.gz |
* Fix memory leaks, fd leaks, and some long-standing bugs recognizing when
targets need to have their modtimes rechecked (-n, etc.)
Diffstat (limited to 'rule.c')
-rw-r--r-- | rule.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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); |