Fix memory leak of updating addresses