The author (or his company) always has the copyrights (if it is not sold) and thus can license it any way(s) wanted, for example und open source licenses.
Authors in certain countries can also release their code into the public domain -- that would be the only situation where there is no copyright involved anymore.