There is very little information on the transmission of infectious diseases after death.
But there is probably little or no danger that most disease organisms would survive even a few weeks in the inhospitable environment of the average grave.
For survival, a certain organism needs a certain temperature, a certain level of acidity or lack thereof, a certain chemical environment and a certain oxygen level.
It should be only a few days before one of these situations should disappear. Many disease organisms probably die once the blood stops circulating and cools off.
In the case of cholera, a comparatively well-studied disease, the bacterium Vibrio cholerae can live only four to seven days outside the body.
In dead bodies, it is present in the gut only, not even on the skin unless there is moist stool on it, and once the stool dries, it dies.
In stool-contaminated water, a hospitable, moist environment, it lives only a maximum of seven days.
In an unusual case, scientists recently announced an expedition to study the frozen corpses of polar explorers to see if they were killed by the 1918 influenza epidemic.
There is some hope, and some fear, that disease-causing organisms from that period may have survived for study.