With the possible exception of, for instance, a fleet of GEO communications satellites, most spacecraft are going to have very unique requirements. I would imagine it's difficult to use the same software on different missions, if it's possible at all.
To what extent is flight software unique to the mission? Are large swaths of code shared within institutions? What about between different institutions? Has any mission just thrown their code onto SourceForge?