I've been working on some piece of software while being "employed" by company A. I now want to continue working on the same software while being employed by company B. Company B wants the software to become open-source to prevent any future legal issues between company A and them. I will consult company A's lawyer to make sure it's fine by them, but I suspect it will be alright as company A is actually a public university which looks favorably on industry connections.
However, I am concerned by potential competitors getting access to that code before we make its results public. Is it possible to make the software open-source without sharing it with anyone but company B (neither in binary nor source form), or do I have to publish the software the minute it is made open-source or shared with anyone?
If the answer depends on the specific open-source license used, please be kind and provide details about the differences.