It might be a bad memory card. Try doing a full (not Quick) format. For CF cards, this will have to be done in a computer, but you can do it in camera for a SD card if you select the option.
A full or low level format will erase every memory location, and mark bad sectors so the camera will not try to write data to them and hang.
Formatting a CF card in camera does not detect bad memory sectors, it just updates the fat table to indicate that the card is empty. Its always a good idea to do a in camera format after a low level format in your computer.
Other than a bad memory card, I'd send it to canon, or exchange it for another with your dealer.