scandir leak patch

Joel Sherrill
Mon Nov 24 20:13:00 GMT 2008

Attached is the current newlib scandir.c with
the "goto cleanup_and_bail" modification from
the RTEMS one plus an explicit check for 0
entries from the fstat.

How does this look?

2008-11-24  Joel Sherrill <>

    * libc/posix/scandir.c: Fix memory leaks.

Joel Sherrill, Ph.D.             Director of Research & Development        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scandir.diff
Type: text/x-patch
Size: 2582 bytes
Desc: not available
URL: <>

More information about the Newlib mailing list