It is normal for the skin to get infected when proper hygiene of the razor is not followed.
You should wash your leg with warm water and soap thoroughly, wipe it with a soft tissue
, then, apply antibiotic cream locally.
If no progress, can consult a physician to start antibiotic treatment orally or to get the infected area surgically worked.
Hope it helped!