Fix use-after-free in network address lookups.