This answer is
not correct. You are correct that the carboxylic acid reacted with the thionyl
chloride and formed the acid chloride and this reacted with the methanol to form
an ester. However, alcohols also react with thionyl chloride to form alkyl
chlorides. Therefore there is a better answer than this response.