But there are performance, security and other issues.
What if it is significantly more performant for getenv() (or whatever) to fetch needed data using alloca (on stack, with fallback to heap/malloc)?
Returning naked pointer is far from being flexible really.