Your squirrel is just chiilin out. We have a lot of squirrels and they do that all the time in our trees. You should see our squirrels hanging on the telephone wires with all four legs dangling. Unless you see him limping don't worry about it.
Does the squirrels foot look red like the squirrel's foot in the picture that Paulette King took in her backyard in Lisbon, Maine. She is the person who put the chairs up in her trees for the squirrels. She calls this one Chubby.
I hope your squirrel is OK. We had a squirrel with a broken leg that fully recovered on its own after we kept it supplied with food and water. They have remarkable healing abilities when it they have that type of injury. It would tear at our hearts to see the poor squirrel climb up the tree with the right hind leg, from the hip to the foot, unusable and and dragging along. He had no control over it, that's how bad it was. We didn't think he was going to make it.