summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mandocdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 6bc5361c..7d63ae60 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1332,6 +1332,8 @@ parse_cat(struct mpage *mpage, int fd)
fopen(mpage->mlinks->file, "r") :
fdopen(fd, "r");
if (NULL == stream) {
+ if (-1 != fd)
+ close(fd);
if (warnings)
say(mpage->mlinks->file, "&fopen");
return;