fix echo server memory leak