Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
Is it the operating system that you want to upgrade, from 10.5 to a higher version?
I don't think there is any such thing as a free upgrade of an operating system (the Windows 10 upgrade was a very new thing, and limited to a small time period - obviously, Microsoft wants to make money too.)
But with any operating system upgrade, from an older OS (such as your computer's 10.5), there is the question as to whether the hardware (the machine/device/computer) that the new upgraded OS is to run on, has drivers for its hardware in the upgraded OS.
In short: if you, for instance, upgraded to 10.12, you might have such an old computer that 10.12 has no drivers for its hardware any more, and find that the upgraded OS is crippled compared to your 10.5 that you had previously.
Also: some software programs on the computer, won't work with 10.12 perhaps.
So upgrading MAC OS X 10.5 isn't just a matter of finding a free upgrade... it is also a set of evaluations and decisions.