What and what?
No, the media at least in the US does not check with the government before publishing in most cases. Especially when it's posted on places like social media first, and then confirmed from other sources later.
>The government must be giving them the all-clear or they would be going to prison
Going by the constitution itself, no. Now in some cases they may go after journalists later, but publishing first is what happens.
The number of attacks recently has got a lot of interest from viewers, they'll report any instance they can. Works the same way for plane crashes. Lots of small aircraft crash, around 3 per day on average. You almost never hear about it until some large aircraft crashes and then you end up seeing much more media attention to said small crashes.