All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ʻalayhi wa sallam, is His slave and Messenger.
That person should have abided by the terms of the contract between him and the company. Allah, the Exalted, says (what means): {O you who have believed, fulfill (all) contracts.} [Quran 5:1] As long as he did not send them the notice before leaving the house during the agreed-upon period, he is obliged to pay the rent of that month, unless the company waives it and clears him of his liability of it. Accordingly, he either informs them of the truth of the matter and if they then clear him of his liability, then there is no harm on him in that case; or, if he cannot inform them for fear of harm or the like, then he may pay them the money, even if indirectly by depositing it in their bank account, for instance, or by giving it to someone to deliver it to them without informing them of what that person had done.
Allah knows best.