sortedcache: plug leaked file descriptor
diff --git a/src/sortedcache.c b/src/sortedcache.c
index ed4199b..5bd989a 100644
--- a/src/sortedcache.c
+++ b/src/sortedcache.c
@@ -216,6 +216,7 @@ int git_sortedcache_lockandload(git_sortedcache *sc, git_buf *buf)
if (p_fstat(fd, &st) < 0) {
giterr_set(GITERR_OS, "failed to stat file");
error = -1;
+ (void)p_close(fd);
goto unlock;
}