Literally:to grasp the Buddha’s foot in an emergency
Meaning:to seek help at the last moment;
to make a frantic last-minute effort
This comes from a longer phrase which runs:
When idle he neglects to burn incense,
yet when in trouble he desperately clutches the Buddha’s feet.
However, a teacher at the Chinese Language Department of Huizhou College believes that such desperate cramming [=Buddha leg clutching] just before the exams in no way contributes to the students’ understanding of their subjects, and thus is undesirable.
In colloquial use it is more common to say:
lín shí bào fó jiǎo
And this fits better with the whole phrase:
píng shí bù shāo xiāng, lín shí bào fó jiǎo