Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2013 08:14:10 GMT
From:      Priit Järv <priit@cc.ttu.ee>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   docs/179832: manual page of mac_from_text suggests incorrect freeing of mac_t type
Message-ID:  <201306220814.r5M8EAIM064799@oldred.freebsd.org>
Resent-Message-ID: <201306220820.r5M8K0Ra039650@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         179832
>Category:       docs
>Synopsis:       manual page of mac_from_text suggests incorrect freeing of mac_t type
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 22 08:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Priit Järv
>Release:        9.1-RELEASE (the problem persists in head/stable)
>Organization:
>Environment:
FreeBSD test 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Sat May 11 16:22:59 EEST 2013     root@test:/usr/obj/usr/src/sys/MACTEST  amd64
>Description:
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.

>How-To-Repeat:
man mac_text
>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.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306220814.r5M8EAIM064799>