Bottom line up front - replace the fitting.
Just looking at the picture it appears the fitting is deformed. The gray threaded piece looks like it expanded and is not holding the white elbow in place correctly . It could have been caused by a defective fitting from the get-go and it decided to fail. It could have been caused by the connection being too tight on the water heater. It could have been caused by a pressure build up which is normal and caused the fitting to fail before the T&P valve opened. It could have been caused by the water heater overheating due to a bad thermal cutoff and expanding the connection between the gray and white parts. Regardless, replace the fitting. You should be able to find a brass fitting at a big box hardware store.
__________________
|