Specifically, at line 10545 and line 10546, function getFormattedTypeName() is called, which allocates a chunk of memory by using pg_strdup() and returns it.
I'm not a C programmer but am operating under the assumption that you are probably incorrect. So I took a cursory look at the code (in HEAD), starting with the function comment. It says:
"* Note that the result is cached and must not be freed by the caller."