From 42f90ed7abf25bd99b0acdcd93c6e9f644e0b875 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 24 Oct 2002 01:01:29 +0000 Subject: mac_free() no longer accepts a void * parameter; only mac_t's are supposed to be passed. Point this out in a warning notice, which will eventually go away, sometime between now and -RELEASE. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs --- lib/libc/posix1e/mac_free.3 | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'lib/libc/posix1e/mac_free.3') diff --git a/lib/libc/posix1e/mac_free.3 b/lib/libc/posix1e/mac_free.3 index a29be1a..ab39b45 100644 --- a/lib/libc/posix1e/mac_free.3 +++ b/lib/libc/posix1e/mac_free.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2001 Networks Associates Technology, Inc. +.\" Copyright (c) 2001, 2002 Networks Associates Technology, Inc. .\" All rights reserved. .\" .\" This software was developed for the FreeBSD Project by Chris @@ -43,21 +43,18 @@ .Sh SYNOPSIS .In sys/mac.h .Ft int -.Fn mac_free "void *buf_p" +.Fn mac_free "mac_t label" .Sh DESCRIPTION The .Fn mac_free -function frees the storage allocated to contain either a -.Vt mac_t -or a -.Vt char * , -as allocated by the -.Fn mac_to_text -function. +function frees the storage allocated to contain a +.Vt mac_t . .Sh RETURN VALUES The .Fn mac_free function always returns 0. +WARNING: see the notes in the BUGS section regarding the use of this +function. .Sh SEE ALSO .Xr mac 3 , .Xr mac_get 3 , @@ -71,3 +68,17 @@ To join this list, see the .Fx POSIX.1e implementation page for more information. +.Sh BUGS +POSIX.1e specifies that +.Fn mac_free +will be used to free text strings created using +.Xr mac_to_text 3 . +Because +.Vt mac_t +is a complex structure in the TrustedBSD implementation, +.Fn mac_free +is specific to that type, and must not be used to free the character +strings returned from +.Fn mac_to_text . +Doing so may result in undefined behavior, +including application failure. -- cgit v1.1