diff options
-rw-r--r-- | lib/libskey/skeylogin.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index b8533ca4fd6..3a34dc89703 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -10,7 +10,7 @@ * * S/Key verification check, lookups, and authentication. * - * $OpenBSD: skeylogin.c,v 1.46 2002/06/22 02:13:10 deraadt Exp $ + * $OpenBSD: skeylogin.c,v 1.47 2002/11/16 22:31:55 millert Exp $ */ #include <sys/param.h> @@ -64,8 +64,10 @@ skeychallenge(mp, name, ss) return (0); case 1: /* User not found */ - (void)fclose(mp->keyfile); - mp->keyfile = NULL; + if (mp->keyfile) { + (void)fclose(mp->keyfile); + mp->keyfile = NULL; + } /* FALLTHROUGH */ default: /* File error */ |