HomeFreeBSD

Fix memory leaks during "tail -r" of an irregular file

Description

Fix memory leaks during "tail -r" of an irregular file

  • Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done.
  • Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory.
  • Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

Details

Provenance
asomersAuthored on
Reviewer
ngie
Differential Revision
D9067: Fix memory leaks during "tail -r" of a non-regular file
Parents
rS311894: Fix typo from change 310985 in ObsoleteFiles.inc
Branches
Unknown
Tags
Unknown