she goes to confession first so that she can return to the sacraments. Since with a young child there is every chance she may someday want to be free to marry again, she should lay the facts of the situation before her priest (outside the confessional) to determine if the marriage was invalid, submitting the facts to the tribunal of the diocese if necessary. Only your priest can guide you, every marriage/divorce situation is different, waste of time to discuss it here.
As far as the baby being baptized, as long as it was with water and the trinitarian formula it is valid. Get the proof of it now from that minister so when the child is ready to begin sacramental preparation for 1st communion and confirmation you have it. For a baptized child below the age of reason, if his parents become (or return to the faith) Catholic that “covers” the child. The facts will be noted in the baptismal record of your parish. Be sure to tell the priest when you discuss the other matter.