diff --git a/lib/krb5/store_stdio.c b/lib/krb5/store_stdio.c index 8c624cd9a..80323e1d8 100644 --- a/lib/krb5/store_stdio.c +++ b/lib/krb5/store_stdio.c @@ -215,8 +215,10 @@ krb5_storage_stdio_from_fd(int fd_in, const char *mode) return NULL; f = fdopen(fd, mode); - if (f == NULL) + if (f == NULL) { + (void) close(fd); return NULL; + } errno = saved_errno;