From what you are describing, I would be worried that your dog could either have a vaginal infection or a urinary tract infection, with the history of a foul odor. It is very common for our older female dogs, especially spayed female dogs, to develop urinary incontinence as they get older. The incontinence can occur at any time of day, but is often worse at night. When the urine leaks, it keeps the hair around their vulva moist, and can allow bacteria from the skin and environment to move up to urinary tract, and lead to an infection. There can also be changes to the position of the vulva as dogs age (recessed vulva) which can make them more susceptible to urinary and vaginal infections.
If your dog is not spayed, one very serious worry would be that she could have a pyometra, or uterine infection, which is a surgical emergency. If she is not spayed and has these signs, I would have her seen by your veterinarian right away.
I would definitely recommend having her evaluated by her veterinarian as soon as possible if she is spayed. After an examination, I would recommend complete bloodwork (a complete blood count to check red cell, white cell, and platelet counts and a serum chemistry to evaluate organ function) as well as a urinalysis and urine culture to check kidney function and rule out urinary tract infection. The reason why it is so important to check kidney function and look for diabetes is that urinary tract infections can lead to kidney infections and increased kidney values and diabetes can increase the risk for urinary tract and vaginal infections. If kidney disease or diabetes are found, then there are dietary and medical treatments which will be needed.
It is completely possible that this is something that can be managed with antibiotics (if this is a urinary tract infection or vaginal infection). If incontinence is suspected, a medication called PPA (phenylpropanolamine) can be very helpful. I do not recommend supplmenting estrogen to treat incontinence, as it can suppress, sometimes permanently, bone marrow function.
I hope this information is helpful and that your girl is feeling better soon.
106 satisfied customers