From 4b46531e484bf59b0c2607f5e7d73ec6e258027d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 18 Mar 2008 19:57:40 +0000 Subject: [PATCH] Don't try to cleanup nsswitch if it has not been initialized. --- sudo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sudo.c b/sudo.c index 4040a13ae..5a90eb2ba 100644 --- a/sudo.c +++ b/sudo.c @@ -1386,8 +1386,10 @@ cleanup(gotsignal) struct sudo_nss *nss; if (!gotsignal) { - tq_foreach_fwd(snl, nss) - nss->close(nss); + if (snl != NULL) { + tq_foreach_fwd(snl, nss) + nss->close(nss); + } sudo_endpwent(); sudo_endgrent(); } -- 2.40.0