Fix small leak in ports validation at startup