This is a reference to trying to walk straight (walk a line) and pass a field sobriety test, while drunk or intoxicated, in front of a Law Enforcement Officer.
A man passes a field sobriety test while drunk by walking in a straight line. By walking straight, he is released and free to go, even though he broke the law. He fooled the cop and does not have to go to jail.