diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-12-01 05:59:45 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-12-01 05:59:45 +0000 |
commit | 20a32450f595e2d9e3c978c9c829df07e74bae08 (patch) | |
tree | 7e72448b44726b4ca855eda1aff739ab41511a0c /usr.bin | |
parent | b30ab4a9e9bcfd19d3eaa3aa8efdeeab1e309da1 (diff) | |
download | FreeBSD-src-20a32450f595e2d9e3c978c9c829df07e74bae08.zip FreeBSD-src-20a32450f595e2d9e3c978c9c829df07e74bae08.tar.gz |
Quickly fix brokeness in revision 1.157, that change was
free()ing stack memory which causes the program to abort,
and I can no longer make buildworld.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 706829c..d3170f5 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -236,14 +236,14 @@ Main_ParseWarn(const char *arg, int iscmd) static Boolean ReadMakefile(const char p[]) { - char *fname; /* makefile to read */ + char *fname, *fnamesave; /* makefile to read */ FILE *stream; char *name, path[MAXPATHLEN]; char *MAKEFILE; int setMAKEFILE; /* XXX - remove this once constification is done */ - fname = estrdup(p); + fnamesave = fname = estrdup(p); if (!strcmp(fname, "-")) { Parse_File("(stdin)", stdin); @@ -299,7 +299,7 @@ ReadMakefile(const char p[]) if (!name) name = Path_FindFile(fname, &sysIncPath); if (!name || !(stream = fopen(name, "r"))) { - free(fname); + free(fnamesave); return (FALSE); } MAKEFILE = fname = name; @@ -313,7 +313,7 @@ found: Var_SetGlobal("MAKEFILE", MAKEFILE); Parse_File(fname, stream); } - free(fname); + free(fnamesave); return (TRUE); } |