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.