zfs/lib/libspl
Ryan Moeller f4def7ec6c FreeBSD: Fix leaked strings in libspl mnttab
The FreeBSD implementations of various libspl functions for getting
mounted device information were found to leak several strings which
were being allocated in statfs2mnttab but never freed.

The Solaris getmntany(3C) and related interfaces are expected to return
strings residing in static buffers that need to be copied rather than
freed by the caller.

Use static thread-local storage to stash the mnttab structure strings
from FreeBSD's statfs info rather than strings allocated on the heap by
strdup(3).

While here, remove some stray commented out lines.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12961
2022-02-03 15:28:01 -08:00
..
include FreeBSD: fix world build after 143476ce8 2022-02-03 15:28:01 -08:00
os FreeBSD: Fix leaked strings in libspl mnttab 2022-02-03 15:28:01 -08:00
Makefile.am libspl: implement atomics in terms of atomics 2021-06-21 21:48:31 -07:00
assert.c
atomic.c libspl: implement atomics in terms of atomics 2021-06-21 21:48:31 -07:00
list.c
mkdirp.c
page.c
strlcat.c
strlcpy.c
timestamp.c