Path: blob/main/crypto/krb5/src/lib/gssapi/mechglue/g_rel_buffer.c
39586 views
/* #ident "@(#)g_rel_buffer.c 1.2 96/02/06 SMI" */12/*3* Copyright 1996 by Sun Microsystems, Inc.4*5* Permission to use, copy, modify, distribute, and sell this software6* and its documentation for any purpose is hereby granted without fee,7* provided that the above copyright notice appears in all copies and8* that both that copyright notice and this permission notice appear in9* supporting documentation, and that the name of Sun Microsystems not be used10* in advertising or publicity pertaining to distribution of the software11* without specific, written prior permission. Sun Microsystems makes no12* representations about the suitability of this software for any13* purpose. It is provided "as is" without express or implied warranty.14*15* SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,16* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO17* EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR18* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF19* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR20* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR21* PERFORMANCE OF THIS SOFTWARE.22*/2324/*25* glue routine for gss_release_buffer26*/2728#include "mglueP.h"29#include <stdio.h>30#ifdef HAVE_STDLIB_H31#include <stdlib.h>32#endif3334OM_uint32 KRB5_CALLCONV35gss_release_buffer(OM_uint32 *minor_status, gss_buffer_t buffer)36{37if (minor_status)38*minor_status = 0;3940/* if buffer is NULL, return */4142if(buffer == GSS_C_NO_BUFFER)43return(GSS_S_COMPLETE);4445if ((buffer->length) &&46(buffer->value)) {47gssalloc_free(buffer->value);48buffer->length = 0;49buffer->value = NULL;50}5152return (GSS_S_COMPLETE);53}545556