From 3d673e1a84f7b7f238eeab1d52469fc06197bce1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 30 Dec 2014 20:41:00 +0000 Subject: 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 . --- mandocdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mandocdb.c b/mandocdb.c index a2fac202..fc5cdb85 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.179 2014/12/09 07:29:42 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.180 2014/12/30 20:41:00 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -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; } -- cgit v1.2.3-56-ge451