-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FreeBSD: Fix leaked strings in libspl mnttab
The FreeBSD implementations of various libspl functions for getting mounted device informantion 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. Signed-off-by: Ryan Moeller <[email protected]>
- Loading branch information
Ryan Moeller
authored and
Ryan Moeller
committed
Jan 11, 2022
1 parent
d6c1bbd
commit 9cae5d7
Showing
1 changed file
with
44 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters