To have an honorable discharge is it, but it's not always "free".
When you register, they will have you fill out a form with the financial information, pretty complete I might add, and then they will determine if you qualify for free, or part pay benefits.
The same for medications, where if the total income is low enough, medications will cost you $8.00 per month, no matter the actual drug store cost, or normal retail, but if your income is higher, then a small payment will be charged.
I am on many medications, but for example, one in particular has a cost of $357.00 per month from a discount drug store, but through the VA it's only $8.00.
Although I'm not sure, I believe a medical discharge will also serve as qualification.