This question already has an answer here:
- Why is a bris performed after death? 2 answers
Recent tragedy in NY, young haredi couple killed in auto accident. Wife pregnant with baby boy. Doctors delivered the baby but, tragically, he also didn't survive. Before burial, a brit milah was performed on the dead infant. What, if any, is the halachic basis for this?