Hello John, Thank you for having a look at the patch. I apologise as the patch is indeed a bit rushed.
On Thu, Apr 10, 2025 at 10:15:02PM -0500, John Goerzen wrote: > Thank you for sending this patch! I don't believe it's correct, > however. > > On line 202, curcwd is malloced. Overwriting it prevents freeing it > later, so this creates a memory leak. > > I suspect the later instance also has that issue. I see what you mean. Instead of allocating the memory on line 202, would it not be possible to dynamically allocate with getcwd(NULL, 0) when that function is available? Is there any case that would not be covered by this? > How exactly is getcwd() defined and used on Hurd? My understanding is that on Hurd getcwd() is just defined in glibc. Looking at the comment in https://sources.debian.org/src/glibc/2.41-7/io/getcwd.c/?hl=39#L25 Many thanks, João