This explains it.
"As a normal release, the base salary for the current year (and future years) evaporates, but the bonus allocation remains. Not only would the club have to deal with the $10.7 million from 2017, but the amounts previously scheduled to hit in 2018 and 2019 would accelerate and be included in the 2017 cap. That would be a total cap hit of $19.6 million. Since Romo was scheduled to count $24.7 million against the cap, the total savings from his release would have been $5.1 million. This amount would be available immediately."