I think it was a Roman law, and it said that when a horrific crime was committed, the criminal could not be named, and anyone who disobeyed would suffer capital punishment. I can't remember the name, although I think it may have started with an 'H'/
I believe you are thinking of
Herostratus, the name of the man for whom the law was created (according to the History, he set fire to the temple of Artemis in Ephesus just in order to be famous and recorded in the History1)
More generally, that law (and other similar like those of romans, egyptians and the like) are usually called
damnatio memoriae; usually they were applied against previous rulers or powerful officials who had fallen of grace, and included destroying their statues, erasing any written (or sculpted) apparition of their name.
Note: Ostracism was the name of exile. The name came because, being a severe punishment, it was usually decreed by all voting members of the polis which used ceramic pieces (ostrakas) to vote.
1: As you can see, he succeeded and the law failed.