Do not free buffer returned by getcwd() if it was not obtained by getcwd(), bug #125701, thanks Mike.
Changed paths: