I believe the confusion between '500,000 lines' in the question vs '2.5 million/3.5 million' in the answers is the context.
The 500,000 number is involved in the entry, descent, and landing (EDL) process specifically, and the rover systems are millions overall.
Not sure why the values are 1m different, but the 2.5m citation is what is in the linked PDF.
It's hard for me to imagine 1M lines of code being written/generated in a year and then flown. I suspect either the first person was responsible for testing only 2.5M lines of it, or they used different counting methods.
As the one who posted the larger figure, I'd say it's more reliable because it comes from the man who sat at the Flight Control station in the control center :D
I'd think this is right, because the answer that gives the 2.5 million loc number also says that this code is descended from the code for Spirit/Oppie and further from Soujourner, but the EDL system for Curiosity is so different from the ones for the older rovers, it has to involve a lot of entirely new code.