=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- src/usr.bin/mandoc/mandocdb.c 2014/08/08 17:36:21 1.113 +++ src/usr.bin/mandoc/mandocdb.c 2014/08/23 01:00:20 1.114 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.113 2014/08/08 17:36:21 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.114 2014/08/23 01:00:20 doug Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -1321,6 +1321,8 @@ fopen(mpage->mlinks->file, "r") : fdopen(fd, "r"); if (NULL == stream) { + if (-1 != fd) + close(fd); if (warnings) say(mpage->mlinks->file, "&fopen"); return;