gss_release_buffer.c revision 153838
114258Sgibbs/*-
214258Sgibbs * Copyright (c) 2005 Doug Rabson
314258Sgibbs * All rights reserved.
414258Sgibbs *
514258Sgibbs * Redistribution and use in source and binary forms, with or without
614258Sgibbs * modification, are permitted provided that the following conditions
714258Sgibbs * are met:
814258Sgibbs * 1. Redistributions of source code must retain the above copyright
914258Sgibbs *    notice, this list of conditions and the following disclaimer.
1014258Sgibbs * 2. Redistributions in binary form must reproduce the above copyright
1114258Sgibbs *    notice, this list of conditions and the following disclaimer in the
1214258Sgibbs *    documentation and/or other materials provided with the distribution.
1314258Sgibbs *
1414258Sgibbs * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1514258Sgibbs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1614258Sgibbs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1714258Sgibbs * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1814258Sgibbs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1914258Sgibbs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2014258Sgibbs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2114258Sgibbs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2214258Sgibbs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23117700Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24117700Smarkm * SUCH DAMAGE.
25117700Smarkm *
26119418Sobrien *	$FreeBSD: head/lib/libgssapi/gss_release_buffer.c 153838 2005-12-29 14:40:22Z dfr $
27119418Sobrien */
28119418Sobrien
2914258Sgibbs#include <gssapi/gssapi.h>
3014258Sgibbs
3114258SgibbsOM_uint32
3218892Sbdegss_release_buffer(OM_uint32 *minor_status,
3345791Speter		   gss_buffer_t buffer)
3445791Speter{
3514258Sgibbs
3645791Speter	*minor_status = 0;
3745791Speter	if (buffer->value)
38117700Smarkm		free(buffer->value);
3914258Sgibbs	buffer->length = 0;
4014258Sgibbs	buffer->value = 0;
4152549Smdodd
42117700Smarkm	return (GSS_S_COMPLETE);
4314258Sgibbs}
44112845Smdodd