W6 2371 then W4 7547 at Madrid
Budapest → Madrid → Málaga
Timetable, Madrid time
19:15W6 2371 from Budapest at the gate
18:25W4 7547 to Málaga leaves the gate
23 h 10 apart on the timetable, overnight
W4 7547 leaves 23 h 10 after W6 2371 arrives on the timetable: more than half a day, so not a connection we count.