One is right and one is wrong!
The verb 'risk' is always followed by the gerund.
For example, "He risked losing all his money". If you hear someone say "He risked to lose..", it is a mistake.
You would only see 'to'+infinitive' after the verb 'risk' in sentences where 'risk' has a noun as a direct object and the 'to+infinitive' is an infinitive of purpose. For example:
"He risked his life to save his friend".