add missing fdopendir() error check in read_dirlist()
diff --git a/lib/fileindex.c b/lib/fileindex.c
index fb6e5d9..0680a58 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -860,6 +860,8 @@ read_dirlist(struct got_pathlist_head *dirlist, int dirfd, const char *path)
return got_error_from_errno("lseek");
dir = fdopendir(dirfd);
+ if (dir == NULL)
+ return got_error_from_errno2("fdopendir", path);
for (;;) {
de = malloc(sizeof(struct dirent) + NAME_MAX + 1);
if (de == NULL) {