Those caught in Malaysia were deported to Thailand. According to a report, here is how it works:
This is an account by one who was caught:
The Malaysian Government however, denied the allegation:
Evidence of beating by the Thai Police (top). In Malaysia, illegal immigrants caught are subjected to imprisonment and caning
Further reports on the treatment of refugees and illegal immigrants in Malaysia.