Because your entire itinerary is international, your baggage charges (or waivers) will be handled as international.
You will pick up your baggage only in Malaga. You will go through a passport check in Madrid, but you won't have to pick up your bags there.