Path: blob/main/crypto/krb5/src/lib/gssapi/generic/rel_buffer.c
39563 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* #ident "@(#)g_rel_buffer.c 1.2 96/02/06 SMI" */23/*4* Copyright 1996 by Sun Microsystems, Inc.5*6* Permission to use, copy, modify, distribute, and sell this software7* and its documentation for any purpose is hereby granted without fee,8* provided that the above copyright notice appears in all copies and9* that both that copyright notice and this permission notice appear in10* supporting documentation, and that the name of Sun Microsystems not be used11* in advertising or publicity pertaining to distribution of the software12* without specific, written prior permission. Sun Microsystems makes no13* representations about the suitability of this software for any14* purpose. It is provided "as is" without express or implied warranty.15*16* SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,17* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO18* EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR19* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF20* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR21* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR22* PERFORMANCE OF THIS SOFTWARE.23*/2425/*26* glue routine for gss_release_buffer27*/2829#include "gssapiP_generic.h"3031#include <stdio.h>32#ifdef HAVE_STDLIB_H33#include <stdlib.h>34#endif3536OM_uint3237generic_gss_release_buffer(38OM_uint32 *minor_status,39gss_buffer_t buffer)40{41if (minor_status)42*minor_status = 0;4344/* if buffer is NULL, return */4546if (buffer == GSS_C_NO_BUFFER)47return(GSS_S_COMPLETE);4849if (buffer->value) {50gssalloc_free(buffer->value);51buffer->length = 0;52buffer->value = NULL;53}5455return (GSS_S_COMPLETE);56}575859