Is UTI and leg pain related

Hello everyone so I got this UTI last week .. i got fever and body ache too...I’m still on antibiotics.. fever not there now...UTI has healed but not completely.. doc also asked me to do a blood test and my hemoglobin came 8.30.. she gave some iron medicine and told me to rest and eat well.. my fever has gone but I have terrible leg cramps/ pain in the legs.. especially in the night.. is it because of UTI or low hemoglobin.. or both?