fix warning ('port' may be used uninitialized in this function)