You are almost correct. What you forgot is the phenomenon that carboxylic acids with a carbonyl group in the beta position, decarboxylate readily with heat losing carbon dioxide and forming an enol. The enol will then undergo tautomerization to reform the carbonyl.