Hello John,

On Sat, Apr 19, 2025 at 11:20:11PM -0500, John Goerzen wrote:
> Every reference I have seen says it's not part of POSIX.  However, Linux
> and the BSDs seem to support it, so might as well just assume it will
> work.  If you have a patch to just go that direction, I'll take it.

Ok, I can send a patch. However I am puzzled by the current code and wanted to
ask you.

Is there not a problem in the case
#if !defined(HAVE_GETCWD) && !defined(HAVE_GET_CURRENT_DIR_NAME)
where getwd(curcwd) would be used but curcwd has not been allocated?

And in the case
#if !defined(HAVE_GETCWD) && defined(HAVE_GET_CURRENT_DIR_NAME)
and get_current_dir_name() is used, but the free(curcwd) is not called
in line 347.
Is this not a memory leak?

Best regards,
João

Reply via email to