Don't use WD40 spray as some advice as it leaves a oil residue that will attract dust.
dhenry will say WD40 is ok...
Seriously though, I was in a pinch and used WD40 on the slide pots on my headset about 8 months ago. It's still working. YMMV.
I too have used it in a pinch, and it can work. But it does ensure you will have to redo it much sooner then if you use one of the better non-residue contact cleaners. The difficult part (with any spray cleaner) is that sometimes it's very difficult to get the spray into the part of the pot or switches that need the cleaning.