It is mentioned in hadeeth that one must not talk bad about dead people.
However the reward and punishment are related to what people talk about which was true! We are Allah’s witnesses on earth and if we talk good about people who had died without lying, this means that this person is generally good at the side of Allah.