I mean under which license is the source code available? I'm not sure if Unity is free software
Quoting the upstream page at Launchpad:
Unity is free software, you are encouraged to use whatever pieces of it suit you.
Licenses: GNU GPL v3, GNU LGPL v3
Unity is available under the GNU Lesser General Public License version 3.
It is certainly protected by copyright. All creative works are - including those released under a free software or 'copyleft' license.
As far as I am aware Canonical hold no patents of any kind - of course it is possible other companies may claim it infringes on their patents.
There has been concern though with the Canonical Contributor Agreement - I've included a brief description below:
In the agreement, the contributor assigns copyright to Canonical, and Canonical simultaneously grants the contributor a very broad license back, so that the contributor retains full rights to re-use, distribute, and continue modifying the contributed code.
Some members of the free software community are concerned that in the future Canonical (or a company that takes over Canonical) could re-license Unity under a non-free license. Others see this as highly unlikely.