Allocate returned buffer in realpath() in case resolved_name's argument is NULL
|Reported by:||oco||Owned by:||korli|
Add support for NULL as resolved_name argument in realpath as defined in The Open Group Base Specifications Issue 7 IEEE Std 1003.1, 2013 Edition (http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html).
In this case, the returned buffer is allocated by realpath and can be passed to free().
The behavior was only "implementation defined" in previous revision like The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition (http://pubs.opengroup.org/onlinepubs/000095399/functions/realpath.html).
Yodl (http://yodl.sourceforge.net/) rely on this behavior in yodl/src/lexer/lchdir.c.