You can ask the same question when energizing a cap and then shorting it out with a wire. Where did the energy go? It went away in a electromagnetic burst of static, arcs, and heat. Whether you de-energize the full cap through a straight wire, another cap, or resistor, the same thing...