]> granicus.if.org Git - sudo/commitdiff
Don't try to cleanup nsswitch if it has not been initialized.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 18 Mar 2008 19:57:40 +0000 (19:57 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 18 Mar 2008 19:57:40 +0000 (19:57 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index 4040a13ae62b81ce15cc8dcea6b8fd6ed8aa8bca..5a90eb2ba1cc876532c7751f924c0f1c24b2cdac 100644 (file)
--- 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();
     }