Assuming we are talking about strangers or someone who I've just met, I would want to take into consideration just what the wardrobe malfunction is, what the surrounding environment is like, and how likely it is that others will notice the problem.
If it is possible to tell the person (in clear words, with no possibility of misunderstanding) about the malfunction without other people overhearing and without getting any closer to the person than normal conversational distance, then I would go ahead and give the warning, without worrying (much) about respective genders/acquaintanceship/power dynamics etc. The more matter-of-fact the warning, the better; focusing on the item of clothing that is malfunctioning, rather than anything that the clothing ought to be covering, is also a good idea.
If you would need to invade the person's personal space in order to give a discreet warning, then I would evaluate based on how uncomfortable that invasion is likely to be and how bad it will be for the person not to be warned.
a. If it's something not-too-embarrassing, like a slip is showing or a zipper is down (but nothing is poking out) then go ahead and lean in a bit to give the warning.
b. If it's something that is extremely personal, like an actual private body part is showing, then I would be more sensitive to power and sex differentials, and weight them against the possible consequences of not telling the person.
This recommended "balancing act" is based on my own comfort levels. As a small woman, I'd be uncomfortable if a strange man sidled up to me to whisper in my ear that my skirt was tucked into my underwear or that my breast was hanging out (I've nursed four babies, so that's happened to me in public). I'd much prefer if he found a nearby female to give me the same message, even though that means that two people would notice the malfunction. If I'd be likely to notice or fix the problem on my own without anyone else seeing (say, everyone else was leaving at the end of a party I was hosting), it would be fine to pretend not to notice at all. However, if we were in a room full of only men (other than me) and the warning prevented me from flashing the rest of the room, that momentary discomfort would be an acceptable trade-off for avoiding much greater embarrassment.
Similarly, I'd be very reluctant to get within touching distance of a strange man to let him know that his penis was hanging out, and would only do so as a last resort (i.e. if there was no other man nearby who could do it) to prevent him from exposing himself further. (Of course, if I suspected it was intentional my approach would be very different.)
Again, if it is necessary to give a warning in a particularly sensitive situation, being very formal and clothing-focused is better: "You probably want to adjust your blouse" is much less cringe-inducing than "I can see your tit." It's also a good idea to keep body language as stand-offish as possible, within the confines of getting close enough to be heard by the other person but not the whole room: don't touch the other person if you can possibly help it, keep your eyes focused above the other person's neck, step back as soon as you're sure the message was understood, look away if possible while adjustments are made, etc.