zfs/lib
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
..
libavl cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libefi cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libicp cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libnvpair Upgrade to libabigail 2.0.0 2021-11-05 07:59:40 -07:00
libshare freebsd/libshare: nfs: don't send SIGHUP to all processes 2022-02-03 15:28:01 -08:00
libspl FreeBSD: Fix leaked strings in libspl mnttab 2022-02-03 15:28:01 -08:00
libtpool cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libunicode cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libuutil Upgrade to libabigail 2.0.0 2021-11-05 07:59:40 -07:00
libzfs linux: libzfs: mount: fix uninitialised flags 2022-02-03 15:28:01 -08:00
libzfs_core Upgrade to libabigail 2.0.0 2021-11-05 07:59:40 -07:00
libzfsbootenv Upgrade to libabigail 2.0.0 2021-11-05 07:59:40 -07:00
libzpool file reference counts can get corrupted 2021-09-14 12:37:38 -07:00
libzstd cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libzutil zed: Control NVMe fault LEDs 2021-11-05 07:51:21 -07:00
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00