I personally know of two people from one company that were fired for contributing a patch to a popular open sourced IDE that the company used for development, of which the bug hampered the development for the company. It was a strongarmed political move for management to retain control over the personal actions of their employees.
This is all anecdotal anyways. I doubt it happens all the time, but these two were forced to sign an NDA on their way out. It makes me wonder how many times it does happen where no one is allowed to talk about it.