From ba2adca5db153702b4f8809e88175444e1d92fa1 Mon Sep 17 00:00:00 2001 From: harti Date: Thu, 9 Dec 2004 10:00:55 +0000 Subject: 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. --- usr.bin/make/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/make/dir.c') 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); -- cgit v1.1