Simplified parsing in client request address

Simplify parsing, and fix a few memory leaks.