From owner-freebsd-doc@FreeBSD.ORG Sat Jun 22 08:20:00 2013 Return-Path: Delivered-To: freebsd-doc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF2A249A for ; Sat, 22 Jun 2013 08:20:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A9F3C1192 for ; Sat, 22 Jun 2013 08:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5M8K08j039651 for ; Sat, 22 Jun 2013 08:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5M8K0Ra039650; Sat, 22 Jun 2013 08:20:00 GMT (envelope-from gnats) Resent-Date: Sat, 22 Jun 2013 08:20:00 GMT Resent-Message-Id: <201306220820.r5M8K0Ra039650@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Priit Järv Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A4CA046A for ; 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 ; 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 ; 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 Järv To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: docs/179832: manual page of mac_from_text suggests incorrect freeing of mac_t type X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 08:20:00 -0000 >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: