summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/dir.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-12-09 10:00:55 +0000
committerharti <harti@FreeBSD.org>2004-12-09 10:00:55 +0000
commitba2adca5db153702b4f8809e88175444e1d92fa1 (patch)
treedca2f8653cf87e20bd7ed3339756ee3f389221a9 /usr.bin/make/dir.c
parent272be69b395ba911a25b8374186dce1fd7d07ce5 (diff)
downloadFreeBSD-src-ba2adca5db153702b4f8809e88175444e1d92fa1.zip
FreeBSD-src-ba2adca5db153702b4f8809e88175444e1d92fa1.tar.gz
If a path element directory was never opened it is not on the list of
open directories so there is no need to remove it from there. This fixes a core dump introduced by removing the run-time check from Lst_Remove.
Diffstat (limited to 'usr.bin/make/dir.c')
-rw-r--r--usr.bin/make/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index fdaf768..f269196 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1139,8 +1139,8 @@ Dir_Destroy(void *pp)
if (p->refCount == 0) {
LstNode *ln;
- ln = Lst_Member(openDirectories, p);
- Lst_Remove(openDirectories, ln);
+ if ((ln = Lst_Member(openDirectories, p)) != NULL)
+ Lst_Remove(openDirectories, ln);
Hash_DeleteTable(&p->files);
free(p->name);
OpenPOWER on IntegriCloud