I agree that there are laws and they could be enforced after a release occurs, but they would have to prove a legitimate threat in order to have the appropriate punishment enacted.
Let's say Assange was in the UK when he had released these documents (though I honestly don't know in what jurisdiction he was, but for the sake of argument, let's say the UK). Now, if he'd revealed any information of a personal nature, at the very least the persons affected could sue him. I'm sure the US government would be more than happy to pay those Afghans' flights to the UK, hire them a lawyer, and sue his ass on their behalf for invasion of privacy.
No, it might not mean prison time, but it will still bankrupt him.