In what state is this taking place? That matters because this is an issue of state law. I disagree with the lawyer that told you it was "unjust enrichment." That attorney may have forgotten that unjust enrichment is a remedy for situations in which a party benefits at the expense of another but and there is no contract between them. The courts remedy that unjust circumstance by imposing relief much like there was a contract, thus unjust enrichment is known as quasi-contractual remedy since the situation is not truly a contract, but the court effectively treats it like one.
But that's not to say that attorney got it wrong that there is a problem here. The basic rule of contract law here is that the tenant owes rent through the end of the lease term. Thus, the tenant must continue to pay rent even if the tenant leaves well before the lease term expires. But there is also a rule in at least most states that the landlord must mitigate his damages by trying to lease the unit to someone else at a fair market rate. Once the landlord is able to rent it to someone else, the old tenant is only responsible for whatever rent shortfall there is with the new tenant. That is, if the landlord had to lease it at a lower rental rate than the old tenant had the old tenant is still liable for the difference so that the landlord still comes out whole on the deal he made with the old tenant.
The landlord might point to the lease and say you still owe a penalty of 3.5 months rent even if he can lease it right away. The problem for the landlord is that in general penalties are not favored in contract law and courts will generally only uphold them if the penalty is a reasonable amount that roughly compensates for the extra costs/damages that the party incurs from a breach. I have a hard time seeing a penalty of 3.5 months rent as being a reasonable estimate of what those costs would be.
You might want to see a local contract or tenant attorney if the landlord is really going to push that 3.5 months penalty or if the landlord tries to charge you rent for months in which he has a new tenant in the space.