10d511a4eSChris Costello.\" Copyright (c) 2001, 2002 Networks Associates Technology, Inc. 2d97fcfceSRobert Watson.\" All rights reserved. 3d97fcfceSRobert Watson.\" 4d97fcfceSRobert Watson.\" This software was developed for the FreeBSD Project by Chris 5d97fcfceSRobert Watson.\" Costello at Safeport Network Services and NAI Labs, the Security 6d97fcfceSRobert Watson.\" Research Division of Network Associates, Inc. under DARPA/SPAWAR 7d97fcfceSRobert Watson.\" contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS 8d97fcfceSRobert Watson.\" research program. 9d97fcfceSRobert Watson.\" 10d97fcfceSRobert Watson.\" Redistribution and use in source and binary forms, with or without 11d97fcfceSRobert Watson.\" modification, are permitted provided that the following conditions 12d97fcfceSRobert Watson.\" are met: 13d97fcfceSRobert Watson.\" 1. Redistributions of source code must retain the above copyright 14d97fcfceSRobert Watson.\" notice, this list of conditions and the following disclaimer. 15d97fcfceSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 16d97fcfceSRobert Watson.\" notice, this list of conditions and the following disclaimer in the 17d97fcfceSRobert Watson.\" documentation and/or other materials provided with the distribution. 18d97fcfceSRobert Watson.\" 3. The name of the author may not be used to endorse or promote 19d97fcfceSRobert Watson.\" products derived from this software without specific prior written 20d97fcfceSRobert Watson.\" permission. 21d97fcfceSRobert Watson.\" 22d97fcfceSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 23d97fcfceSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24d97fcfceSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25d97fcfceSRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 26d97fcfceSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27d97fcfceSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28d97fcfceSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29d97fcfceSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30d97fcfceSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31d97fcfceSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32d97fcfceSRobert Watson.\" SUCH DAMAGE. 33d97fcfceSRobert Watson.\" 34*b653faaaSDag-Erling Smørgrav.Dd September 21, 2023 35d97fcfceSRobert Watson.Dt MAC_FREE 3 36d97fcfceSRobert Watson.Os 37d97fcfceSRobert Watson.Sh NAME 38d97fcfceSRobert Watson.Nm mac_free 39d97fcfceSRobert Watson.Nd free MAC label 40d97fcfceSRobert Watson.Sh LIBRARY 41d97fcfceSRobert Watson.Lb libc 42d97fcfceSRobert Watson.Sh SYNOPSIS 43d97fcfceSRobert Watson.In sys/mac.h 44d97fcfceSRobert Watson.Ft int 450d511a4eSChris Costello.Fn mac_free "mac_t label" 46d97fcfceSRobert Watson.Sh DESCRIPTION 47d97fcfceSRobert WatsonThe 48d97fcfceSRobert Watson.Fn mac_free 490d511a4eSChris Costellofunction frees the storage allocated to contain a 500d511a4eSChris Costello.Vt mac_t . 51d97fcfceSRobert Watson.Sh RETURN VALUES 52d97fcfceSRobert WatsonThe 53d97fcfceSRobert Watson.Fn mac_free 54d97fcfceSRobert Watsonfunction always returns 0. 553b296920SRuslan ErmilovWARNING: see the notes in the 563b296920SRuslan Ermilov.Sx BUGS 573b296920SRuslan Ermilovsection regarding the use of this 580d511a4eSChris Costellofunction. 59d97fcfceSRobert Watson.Sh SEE ALSO 60d97fcfceSRobert Watson.Xr mac 3 , 61d97fcfceSRobert Watson.Xr mac_get 3 , 6276a829fdSChris Costello.Xr mac_prepare 3 , 63d97fcfceSRobert Watson.Xr mac_set 3 , 6476a829fdSChris Costello.Xr mac_text 3 , 653a67af38SRobert Watson.Xr posix1e 3 , 668f8690e7SChris Costello.Xr mac 4 , 6776a829fdSChris Costello.Xr mac 9 68d97fcfceSRobert Watson.Sh STANDARDS 69d97fcfceSRobert WatsonPOSIX.1e is described in IEEE POSIX.1e draft 17. 7009a7f448SRobert Watson.Sh HISTORY 7109a7f448SRobert WatsonSupport for Mandatory Access Control was introduced in 7209a7f448SRobert Watson.Fx 5.0 7309a7f448SRobert Watsonas part of the 7409a7f448SRobert Watson.Tn TrustedBSD 7509a7f448SRobert WatsonProject. 760d511a4eSChris Costello.Sh BUGS 770d511a4eSChris CostelloPOSIX.1e specifies that 780d511a4eSChris Costello.Fn mac_free 790d511a4eSChris Costellowill be used to free text strings created using 800d511a4eSChris Costello.Xr mac_to_text 3 . 810d511a4eSChris CostelloBecause 820d511a4eSChris Costello.Vt mac_t 833b296920SRuslan Ermilovis a complex structure in the 843b296920SRuslan Ermilov.Tn TrustedBSD 853b296920SRuslan Ermilovimplementation, 860d511a4eSChris Costello.Fn mac_free 873a67af38SRobert Watsonis specific to 883a67af38SRobert Watson.Vt mac_3 , 893a67af38SRobert Watsonand must not be used to free the character strings returned from 900d511a4eSChris Costello.Fn mac_to_text . 913a67af38SRobert WatsonDoing so may result in undefined behavior. 92