That's great you got him for free. There's another poster here who has a betta witha back deformity. Here's the thread:
For now, your little guy probably needs a shallow QT tank with warm water and a lowered water level so he can reach the surface easy. You can float his cup in a tank so he stays warm. Get a gallon jug or something like that and mix up 1 gallon of dechlorinated water and 1 tsp of aquarium salt. Let the salt dissolve, then add that to his cup. It will help his fins.