MONDAY, APRIL 20, 2026 GLIBC DIGEST · OPEN-SOURCE SYSTEMS DAILY VOL. 1 · NO. 110
Late Edition · APRIL 20, 2026 · VOL. 1 · NO. 110
The glibc Digest
— A Daily Record of the GNU C Library —
io Proposed

ftw/nftw: Add missing free() calls

Reviewers note that the proposed patch to fix silent readdir failures in ftw/nftw needs `free()` calls and has typos.

DJ Delorie reviews a patch from Adhemerval Zanella that fixes silent readdir failures in ftw/nftw. The review points out missing free() calls in the error handling paths and some typos in the test case.

Technical Tradeoffs

  • The patch adds error handling, increasing code complexity slightly.
  • Failing to free memory on error can lead to memory leaks, potentially destabilizing the application.
Filed Under: ioftwnftwreaddirmemory leak