diff options
author | joerg <joerg@FreeBSD.org> | 1996-12-14 19:53:49 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-12-14 19:53:49 +0000 |
commit | 5476bdc6871cd231f6041ffed18201a40fd63370 (patch) | |
tree | 5f4ce179ffc745f34801c743beca866f4dff0bf6 /usr.sbin/config/mkheaders.c | |
parent | 000a733206a490453542c9e437941673ec57912a (diff) | |
download | FreeBSD-src-5476bdc6871cd231f6041ffed18201a40fd63370.zip FreeBSD-src-5476bdc6871cd231f6041ffed18201a40fd63370.tar.gz |
Part #2 of the config cleanup. More aggressive, replaced an NIH
version of strdup() by a macro, killed many calls to strdup(), thus
potentially wasting less malloc'ed space (their args were never be
free()ed desptie despite of being malloc'ed). Probably still a huge
memory leak at all... Also killed two totally useless variables.
I've tested it as i could, but wouldn't be surprised if unexpected
problems showed up. So watch out this space!
Diffstat (limited to 'usr.sbin/config/mkheaders.c')
-rw-r--r-- | usr.sbin/config/mkheaders.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c index bfa5692..735658d 100644 --- a/usr.sbin/config/mkheaders.c +++ b/usr.sbin/config/mkheaders.c @@ -40,10 +40,13 @@ static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93"; */ #include <stdio.h> +#include <string.h> #include <ctype.h> #include "config.h" #include "y.tab.h" +#define ns(s) strdup(s) + headers() { register struct file_list *fl; @@ -157,7 +160,7 @@ do_header(dev, hname, count) if (oldcount == -1) { fl = (struct file_list *) malloc(sizeof *fl); bzero(fl, sizeof(*fl)); - fl->f_fn = ns(name); /* malloced */ + fl->f_fn = ns(name); fl->f_type = count; fl->f_next = fl_head; fl_head = fl; |