There are several different conditions that could cause problems with gait in young children. I recommend that you schedule an appointment with a pediatric orthopedic doctor
. One of these certainly could be a difference in the length of the two legs, although a difference of 1 mm is very small and I don't expect that amount of difference would be the major cause. I wonder if you might have meant 1 cm? If so then that is a significant difference and could definitely be the cause of the gait problem.
Other conditions that could cause limping or swinging of the legs like you are describing could include a deformity of the hip joints, which is a common congenital bone condition. It is usually picked up in babies, but subtle cases may be missed and could show up at this age. Additionally, there are other rare deformities of other bones in the legs that can occasionally occur and could also cause gait disturbance.
At the same time, it is worth mentioning that most gait disturbances in toddlers are actually self correcting and don't represent a serious deformity nor require any specific treatment.
The way to sort out the difference would be to have an appointment with a pediatric orthopedic doctor. They'll be able to help you figure out whether this is a problem and whether it needs treatment.