freebsd-dev/contrib/telnet
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
..
arpa Add baud rate support to telnet(1) 2014-11-11 04:06:05 +00:00
libtelnet Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted 2016-08-30 19:02:15 +00:00
telnet Fix warnings in telnet about invalid constant conversions, e.g.: 2016-08-30 20:27:22 +00:00
telnetd Fix memory leak in edithost 2017-06-01 19:21:30 +00:00