I think Foley will, narrowly.
Also, Former State Rep. Jonathan Pelto, a Democrat, is running as a Democrat. If his candidacy catches fire, game over for Malloy.
Pelto is not
running as a Democrat. He is petitioning for ballot access as a candidate of his own "Education and Democracy" party, though he would most certainly attract the votes of liberal Democrats in a general election.
Even if Pelto manages to only win 1-2% of the vote, the margin between Foley and Malloy is likely to be tight enough that a third-party Pelto candidacy could significantly improve Foley's odds of winning the election.