summaryrefslogtreecommitdiff
path: root/rule.c
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2006-03-17 14:24:20 +0000
committerBoris Kolpackov <boris@kolpackov.net>2006-03-17 14:24:20 +0000
commit22886f8a74b5925030889fed52af5a8add5617d7 (patch)
treec28340c4ca8f7956e259f671b3202b6bf0874a35 /rule.c
parent50eb3cf5e5a8a68b68e966a6607f668f2c36191e (diff)
downloadgunmake-22886f8a74b5925030889fed52af5a8add5617d7.tar.gz
Fixed Savannah bug #16053.
Diffstat (limited to 'rule.c')
-rw-r--r--rule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/rule.c b/rule.c
index 527b5b0..e988db5 100644
--- a/rule.c
+++ b/rule.c
@@ -201,12 +201,8 @@ convert_suffix_rule (char *target, char *source, struct commands *cmds)
depname = xmalloc (1 + len + 1);
depname[0] = '%';
bcopy (source, depname + 1, len + 1);
- deps = (struct dep *) xmalloc (sizeof (struct dep));
- deps->next = 0;
+ deps = alloc_dep ();
deps->name = depname;
- deps->ignore_mtime = 0;
- deps->staticpattern = 0;
- deps->need_2nd_expansion = 0;
}
create_pattern_rule (names, percents, 0, deps, cmds, 0);
@@ -428,7 +424,8 @@ freerule (struct rule *rule, struct rule *lastrule)
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->name = 0; /* Make sure free_dep does not free name. */
+ free_dep (dep);
dep = t;
}