UX 138 then FR 5482 at Madrid
Quito → Madrid → Porto
Timetable, Madrid time
05:00UX 138 from Quito at the gate
23:25FR 5482 to Porto leaves the gate
18 h 25 apart on the timetable
FR 5482 leaves 18 h 25 after UX 138 arrives on the timetable: more than half a day, so not a connection we count.