close fd if we're a directory in filemap.

This commit is contained in:
Joris Vink 2018-12-17 16:22:36 +01:00
parent 61b385ae11
commit 0d6a188b01
1 changed files with 1 additions and 0 deletions

View File

@ -280,6 +280,7 @@ lookup:
fd = -1;
}
} else if (S_ISDIR(st.st_mode) && index == 0) {
close(fd);
if (req->path[strlen(req->path) - 1] != '/') {
(void)snprintf(fpath,
sizeof(fpath), "%s/", req->path);