Miscarriage & sex

While miscarrying i have brown light spotting and my sex drive is high. Would i be okay to have sex or can i get infections if i dont wait ?