diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-23 18:13:47 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-23 18:13:47 +0000 |
commit | 0c2d768cbe4570b38ac18d2408449604fab0186b (patch) | |
tree | d4dc94b8c2722fae6daf5c62eda7a7be6476e061 | |
parent | ae002c6959368060572e2f314bddcc0e6562d0ad (diff) | |
download | mandoc-0c2d768cbe4570b38ac18d2408449604fab0186b.tar.gz |
do not leak a file descriptor on fdopen(3) failure; from doug@
-rw-r--r-- | mandocdb.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |