If the priest stays true to the “Seal of Confession”, it shouldn’t be any problem at all. With few and extremely rare exceptions, a priest should compartmentalize anything he hears in a confession. Not only the priest, but also anyone who accidentally overhears a confession.
The obligation of secrecy was effected by Canon 21 of the Fourth Council of the Lateran (1215), the following words:
Let the priest absolutely beware that he does not by word or sign or by any manner whatever in any way betray the sinner: but if he should happen to need wiser counsel let him cautiously seek the same without any mention of person. For whoever shall dare to reveal a sin disclosed to him in the tribunal of penance we decree that he shall be not only deposed from the priestly office but that he shall also be sent into the confinement of a monastery to do perpetual penance.
—Hefele-Leclercq, Histoire des Conciles at the year 1215; Mansi or Harduin, “Coll. conciliorum”—
My source: Wikipedia article with references
edit for references