1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog

The result of a strdup() was stored in a global variable and not freed
before program exit. This is a follow-up to r343906. That change
attempted to plug these resource leaks but managed to miss a code path
on which the leak still occurs. Plug the leak on that path, too.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
This commit is contained in:
David Bright 2019-02-20 22:05:44 +00:00
parent 5ed4fb69ff
commit 2c3e626a0d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344389

View File

@ -793,6 +793,9 @@ usage(void)
fprintf(stderr,
"usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n"
" [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n");
/* Free global dynamically-allocated storage. */
free(timefnamefmt);
free(requestor);
exit(1);
}