summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-30 20:41:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-30 20:41:00 +0000
commit824102957f73b26c300231632f733a22d2a3fd05 (patch)
treeb40d689e17554c4ecdcd8d65f0ef0d2717444f18 /mandocdb.c
parent3c7801b6586ff9d8a6a2cfee05f2784bee905ed4 (diff)
downloadmandoc-824102957f73b26c300231632f733a22d2a3fd05.tar.gz
When a file is given on the command line, actually exists, and its name
relative to the respective manual tree is longer than PATH_MAX, do not leak the memory allocated to hold the name. Not sure that can actually happen, but better safe than sorry. FreeBSD Coverity Scan CID 1261303, reported by Pedro Giffuni <pfg@>.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 0cb487b1..0f26771d 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -852,6 +852,7 @@ filescan(const char *file)
if (strlcpy(mlink->file, start, sizeof(mlink->file)) >=
sizeof(mlink->file)) {
say(start, "Filename too long");
+ free(mlink);
return;
}