>If you want to do open-source work on an area related to your job you must talk to your employer first
It isn't the law, but a some employment agreements give de factor ownership of any intellectual property an employee produces to the company, own time or not.