check for fclose() failure in get_file_status()
diff --git a/lib/worktree.c b/lib/worktree.c
index b5e37a2..9eb8aa6 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1210,7 +1210,7 @@ get_file_status(unsigned char *status, struct stat *sb,
done:
if (blob)
got_object_blob_close(blob);
- if (f)
+ if (f != NULL && fclose(f) == EOF && err == NULL)
fclose(f);
if (fd != -1 && close(fd) == -1 && err == NULL)
err = got_error_from_errno2("close", abspath);