Praise be to Allah.
If this discharge comes out of you continually, meaning that you cannot control it, then you come under the same ruling as one who is suffering from urinary incontinence: so you must do wudu’ for each prayer after the time for it begins, and you should securely place a tissue or something over your private part; after that, it will not matter if something comes out of you.
Based on that, you must do wudu’ again and repeat the second prayer, and you must also purify your clothing and body of any traces of impurity (najasah), because you have to do wudu’ for every prayer.
But if it comes out at certain times, or it only comes out sometimes, and is not continuous, then this invalidates wudu’. So if it comes out whilst you are praying, you must repeat wudu’ and repeat the prayer, and you must wash off whatever of it has got onto your body or clothes.
The scholars of the Permanent Committee for Ifta’ said:
If the situation is as described in the question, that the emission of the smell from the place mentioned is not constant, and it comes out against his will sometimes, then if it comes out of him whilst he is praying or otherwise, he must repeat wudu’."(Fatawa al-Lajnah ad-Da’imah – vol. 2 4/256).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked: If thin clear liquid comes out of someone, before or after urinating, without any feelings of pleasure and not as a result of looking or thinking, what is the ruling on that?
What appears to be the case is that this does not result from desire or thinking, as is mentioned at the end of the question. Based on that, it cannot be regarded as madhiy (prostatic fluid) or maniy (semen) – rather it appears to be a kind of residue in the ureters which comes out before the urine, and sometimes afterwards. Therefore it comes under exactly the same rulings as urine, meaning that he must purify it and purify whatever it got onto, and do wudu’, and he does not have to do anything more than that."(Majmu‘ Fatawa Ibn ‘Uthaymin 11/223).
If you prayed and then discovered after praying that this liquid had come out, the matter is subject to further discussion:
If you are certain that it came out whilst you were praying, or before you prayed [and after you did wudu’], then your prayer is invalid, and you have to clean yourself, purify your clothing and body of whatever got onto them, and do wudu’ again and repeat the prayer.
If you are not sure whether it came out whilst you were praying, or before or after that, and you are not certain that it came out whilst you were praying or before you prayed, then you do not have to repeat anything, because the basic principle is that you started praying in a state of purity, and the prayer cannot be deemed to have been invalidated on the basis of mere uncertainty.
Shaykh Ibn Baz (may Allah have mercy on him) said:
If someone prays, then finds out after he prayed that some urine or madhiy came out of him, then the matter is subject to further discussion. If he is certain that this came out whilst he was praying, then he must repeat the prayer and he must do wudu’ [before repeating it]; he must clean himself of urine or madhiy, wash the madhiy from his penis and testicles, and he must do wudu’ as prescribed and repeat the prayer. But if he is uncertain, and does not know whether this came out whilst he was praying or after he finished praying, then he does not have to repeat it. If he is uncertain as to whether this urine of which he saw traces came out whilst he was praying, or it came out after he had prayed, then he does not have to repeat his prayer."(Fatawa Nur ‘ala ad-Darb by Ibn Baz).
Shaykh Salih al-Fawzan (may Allah preserve him) was asked:
She prayed ‘Asr, and some time after that she noticed some impurity in her underwear. Does she have to repeat the prayer?
If she did not know whilst she was praying that there was some impurity on her, and she does not know when that happened, then her prayer is valid, because the basic principle is that things are valid. End quote.
And Allah knows best.