Not leaking socket in set ports option