opnsense-src/contrib/telnet/telnetd
Stephen J. Kiernan 3fab177f90 Fix memory leak in edithost
The problem is that when the parameter 'pat' is null, the function locally
allocates a NULL string but never frees it.

Instead of tracking the local alloc, it is noted that the while(*pat) never
enters when there is a local alloc.
So instead of doing the local alloc, check that 'pat' is null before the
while(*pat) loop.

Found using clang's static analyzer - scan-build

Submitted by:	Thomas Rix <trix@juniper.net>
Reviewed by:	markm
Approved by:	sjg (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9689
2017-06-01 19:21:30 +00:00
..
authenc.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00
defs.h Manually unifdef(1) CRAY, UNICOS, hpux and sun uselsess code. 2001-08-29 14:16:17 +00:00
ext.h Convert telnetd(8) to use posix_openpt(2). 2008-11-13 19:05:27 +00:00
global.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00
pathnames.h Code merge and diff reduce with "base" telnet. This is the "later" 2001-08-20 12:28:40 +00:00
slc.c Use __FBSDID vs. rcsid[]. Also protect sccs[] and copyright[] from GCC 3.3. 2003-05-04 02:54:49 +00:00
state.c Make sure that each va_start has one and only one matching va_end, 2012-09-28 07:51:30 +00:00
sys_term.c When telnetd(8) composes argument list for login(1), an unexpected sequence 2016-12-06 18:50:22 +00:00
telnetd.8 List authentication types supported with "-X" taken from the libtelnet 2008-08-29 00:04:37 +00:00
telnetd.c Improve upon previous commit: 2014-03-02 03:34:06 +00:00
telnetd.h Very large style makeover. 2001-11-30 21:06:38 +00:00
termstat.c Add missing () to function invocation. 2004-07-28 05:37:18 +00:00
utility.c Fix memory leak in edithost 2017-06-01 19:21:30 +00:00