Stanley McChrystal firing

General Stanley McChrystal and journalist Dave Weigel both got fired recently for saying things in public they didn't expect to be quoted on. Did the journalists who quoted them do something wrong? It's hardly a simple question.