K 10 svn:author V 6 stevek K 8 svn:date V 27 2017-06-01T19:21:30.806175Z K 7 svn:log V 567 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 Reviewed by: markm Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9689 END