manual page of mac_from_text(3) notes that the allocated storage should be freed with free(). I strongly suspect this is incorrect, as the type mac_t points to a structure which itself contains a pointer. It seems this was introduced in svn rev 122777 where "mac_free(3)" was changed to "free(3)". It seems the specific change was meant for the mac_to_text() function call (a char* pointer indeed should be freed with free()). Reported for 9.1-RELEASE but still present in head/stable. Fix: Replace the text "which must later be freed with free(3)" with "which must later be freed with mac_free(3)". Additionally, it may be useful to mention in the next section that the text pointer allocated by mac_to_text() should be freed with free() - that seems to have been the intent of commit r122777. How-To-Repeat: man mac_text
Responsible Changed From-To: freebsd-doc->rwatson Over to Robert.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Created attachment 228276 [details] mac_free.3 patch and mac_text.3 patch For mac_text(3), change reference to free(3) back to mac_free(3) for mac_from_text. For mac_free(3), change a variable type from mac_3 to mac_t.
Moving to a base system component so that I can set mfc flags (?)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=081218b7a2006e5b6783e51f66fd751871ac1272 commit 081218b7a2006e5b6783e51f66fd751871ac1272 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2025-10-26 15:10:34 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2025-10-26 15:13:21 +0000 libc: fix description issues in mac_text(3)/mac_free(3) mac_text(3) as-written would seem to indicate that a `mac_t` should be freed with free(3), but this isn't the case. One can derive from context from when the change was introduced and COMPATIBILITY that this was intended to talk about *text in `mac_to_text`, so move the comment there. PR: 179832 Co-authored-by: Priit Järv <priit cc ttu ee> MFC after: 3 days lib/libc/posix1e/mac_free.3 | 4 ++-- lib/libc/posix1e/mac_text.3 | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b5b3bf57e9fb35f8445b92e638a9fe351490825c commit b5b3bf57e9fb35f8445b92e638a9fe351490825c Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2025-10-26 15:10:34 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2026-01-20 04:04:08 +0000 libc: fix description issues in mac_text(3)/mac_free(3) mac_text(3) as-written would seem to indicate that a `mac_t` should be freed with free(3), but this isn't the case. One can derive from context from when the change was introduced and COMPATIBILITY that this was intended to talk about *text in `mac_to_text`, so move the comment there. PR: 179832 Co-authored-by: Priit Järv <priit cc ttu ee> (cherry picked from commit 081218b7a2006e5b6783e51f66fd751871ac1272) lib/libc/posix1e/mac_free.3 | 4 ++-- lib/libc/posix1e/mac_text.3 | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f00ebc7eb3a65494749fb85b3fd8f27ea09296ae commit f00ebc7eb3a65494749fb85b3fd8f27ea09296ae Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2025-10-26 15:10:34 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2026-01-20 04:05:37 +0000 libc: fix description issues in mac_text(3)/mac_free(3) mac_text(3) as-written would seem to indicate that a `mac_t` should be freed with free(3), but this isn't the case. One can derive from context from when the change was introduced and COMPATIBILITY that this was intended to talk about *text in `mac_to_text`, so move the comment there. PR: 179832 Co-authored-by: Priit Järv <priit cc ttu ee> (cherry picked from commit 081218b7a2006e5b6783e51f66fd751871ac1272) lib/libc/posix1e/mac_free.3 | 4 ++-- lib/libc/posix1e/mac_text.3 | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-)
Thanks!