From a730c89376dadded8a8e53ca3b30761ed434c6c1 Mon Sep 17 00:00:00 2001 From: "Roland C. Dowdeswell" Date: Mon, 3 Oct 2016 17:33:52 -0400 Subject: [PATCH] lib/krb5/fcache.c: couple of uses of errno after it may have been changed. --- lib/krb5/fcache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/krb5/fcache.c b/lib/krb5/fcache.c index 1f4c14928..4f1cd11f6 100644 --- a/lib/krb5/fcache.c +++ b/lib/krb5/fcache.c @@ -275,18 +275,20 @@ _krb5_erase_file(krb5_context context, const char *filename) return ret; } if (unlink(filename) < 0) { + ret = errno; _krb5_xunlock(context, fd); close (fd); krb5_set_error_message(context, errno, N_("krb5_cc_destroy: unlinking \"%s\": %s", ""), - filename, strerror(errno)); - return errno; + filename, strerror(ret)); + return ret; } ret = fstat(fd, &sb2); if (ret < 0) { + ret = errno; _krb5_xunlock(context, fd); close (fd); - return errno; + return ret; } /* check if someone was playing with symlinks */