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
..
2016-11-14 00:33:03 +00:00
2017-05-10 22:45:05 +00:00
2017-05-31 19:37:23 +00:00
2017-05-22 01:10:12 +00:00
2016-11-07 15:54:47 +00:00
2017-03-02 01:14:48 +00:00
2017-05-05 14:33:39 +00:00
2017-02-19 17:37:16 +00:00
2017-02-19 17:46:37 +00:00
2017-05-26 00:19:50 +00:00
2017-02-06 08:49:57 +00:00
2017-03-23 22:06:06 +00:00
2017-03-16 21:32:05 +00:00
2017-05-23 09:29:05 +00:00
2017-05-05 13:31:25 +00:00
2017-01-30 16:32:53 +00:00
2017-02-28 23:42:47 +00:00
2017-03-25 14:14:11 +00:00
2017-06-01 19:21:30 +00:00
2017-05-20 18:02:31 +00:00
2017-02-28 23:42:47 +00:00
2017-03-27 21:00:49 +00:00
2017-01-06 07:54:53 +00:00
2017-01-17 05:55:47 +00:00
2017-05-06 10:26:40 +00:00