From nobody@FreeBSD.org  Sat Jun 22 08:14:12 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id A4CA046A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jun 2013 08:14:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 95A2F117A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jun 2013 08:14:12 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r5M8EAlR064800
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jun 2013 08:14:10 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r5M8EAIM064799;
	Sat, 22 Jun 2013 08:14:10 GMT
	(envelope-from nobody)
Message-Id: <201306220814.r5M8EAIM064799@oldred.freebsd.org>
Date: Sat, 22 Jun 2013 08:14:10 GMT
From: Priit Jrv <priit@cc.ttu.ee>
To: freebsd-gnats-submit@FreeBSD.org
Subject: manual page of mac_from_text suggests incorrect freeing of mac_t type
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:    rwatson
>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:  Wed Jan 08 20:10:53 UTC 2014
>Originator:     Priit Jrv
>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:
Responsible-Changed-From-To: freebsd-doc->rwatson 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Wed Jan 8 20:10:21 UTC 2014 
Responsible-Changed-Why:  
Over to Robert. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179832 
>Unformatted:
