Remove unnecessary free
Check if adding host failed