The reaction begins with the nucleophilic addition of aniline (1) to the electron-deficient double bond in the malonic acid ester (2), the alkoxide is ejected and an aniline methylene malonic acid ester (2a), which cycles through a Friedel-Crafts-like reaction to intermediate 2b. This reaction step is called a cancellation. The resulting ester is hydrolyzed to the carboxylic acid 2c, the tautomeric β-ketoester (2d) decarboxylates to 4-hydroxyquinoline (3). Also see
wiki