The getcwd(3) bug was found by valgrind. Bug: 7291287 Change-Id: I59f3bff1c1392a408b905934eebcd5d894d37492