(not) have a leg to stand on

To have no support for your position or opinion, to have no excuse or evidence for something.

The criminal does not have a leg to stand on in his defense.