IIRC, there was a statement made that a person who fixes their bad trait before their child is born, will not pass that trait along to their child.
I'm trying to locate this, but I'm not having any luck. I've tried likut mamarim sefarim and asked some people I thought might know, all to no avail.
I'm pretty sure it was in the gemara and not in a medrash or mussar seffer, but I can't be 100% sure.