mirror_zfs/lib
Ryan Moeller 69c5e694a1
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-01-14 12:38:32 -08:00
..
libavl lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libefi libefi: efi_type: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
libicp Remove sha1 hashing from OpenZFS, it's not used anywhere. 2022-01-06 16:16:28 -08:00
libnvpair libnvpair: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
libshare libshare: nfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
libspl FreeBSD: Fix leaked strings in libspl mnttab 2022-01-14 12:38:32 -08:00
libtpool lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libunicode cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libuutil Add const to nvlist functions to properly expose their real behavior 2021-12-06 18:19:13 -07:00
libzfs linux: libzfs: mount: fix uninitialised flags 2022-01-13 11:07:54 -08:00
libzfs_core libzfs_core: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
libzfsbootenv Add const to nvlist functions to properly expose their real behavior 2021-12-06 18:19:13 -07:00
libzpool Updated the lz4 decompressor 2022-01-07 10:36:49 -08:00
libzstd cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libzutil libzutil: import: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
Makefile.am Simplify and document OpenZFS library dependencies 2021-10-07 11:31:26 -06:00