I have a 2001 Kia Spectre and the ignition switch is going bad and when it does start up, the check engine light comes on.
Take it to a auto parts store. Most have a computer that they can hook up to your vehicle and get the code to determine what the problem may be. It's usually a free service. I know that Autozone does it for sure. But there is usually water in the gas line anyway. That's why people put gas line antifreeze products in there car when in colder climates.
My mechanic tells me that check engine lights are usually related to the emissions control system needing attention. It can be something as simple as a vaccumn hose being broken or loose. Good luck.