17c478bd9Sstevel@tonic-gate /*
2ab9b2e15Sgtb  * Copyright 1996 by Sun Microsystems, Inc.
3*1da57d55SToomas Soome  *
4ab9b2e15Sgtb  * Permission to use, copy, modify, distribute, and sell this software
5ab9b2e15Sgtb  * and its documentation for any purpose is hereby granted without fee,
6ab9b2e15Sgtb  * provided that the above copyright notice appears in all copies and
7ab9b2e15Sgtb  * that both that copyright notice and this permission notice appear in
8ab9b2e15Sgtb  * supporting documentation, and that the name of Sun Microsystems not be used
9ab9b2e15Sgtb  * in advertising or publicity pertaining to distribution of the software
10ab9b2e15Sgtb  * without specific, written prior permission. Sun Microsystems makes no
11ab9b2e15Sgtb  * representations about the suitability of this software for any
12ab9b2e15Sgtb  * purpose.  It is provided "as is" without express or implied warranty.
13*1da57d55SToomas Soome  *
14ab9b2e15Sgtb  * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15ab9b2e15Sgtb  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16ab9b2e15Sgtb  * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17ab9b2e15Sgtb  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
18ab9b2e15Sgtb  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19ab9b2e15Sgtb  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20ab9b2e15Sgtb  * PERFORMANCE OF THIS SOFTWARE.
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate /*
247c478bd9Sstevel@tonic-gate  *  glue routine for gss_release_oid_set
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
27ab9b2e15Sgtb #include "gssapiP_generic.h"
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <stdio.h>
307c478bd9Sstevel@tonic-gate #ifdef HAVE_STDLIB_H
317c478bd9Sstevel@tonic-gate #include <stdlib.h>
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate OM_uint32
generic_gss_release_oid_set(minor_status,set)357c478bd9Sstevel@tonic-gate generic_gss_release_oid_set (minor_status,
367c478bd9Sstevel@tonic-gate 			     set)
377c478bd9Sstevel@tonic-gate      OM_uint32 *		minor_status;
387c478bd9Sstevel@tonic-gate      gss_OID_set *		set;
397c478bd9Sstevel@tonic-gate {
407c478bd9Sstevel@tonic-gate     size_t i;
417c478bd9Sstevel@tonic-gate     if (minor_status)
427c478bd9Sstevel@tonic-gate 	*minor_status = 0;
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate     if (set == NULL)
457c478bd9Sstevel@tonic-gate 	return(GSS_S_COMPLETE);
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate     if (*set == GSS_C_NULL_OID_SET)
487c478bd9Sstevel@tonic-gate 	return(GSS_S_COMPLETE);
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate     for (i=0; i<(*set)->count; i++)
517c478bd9Sstevel@tonic-gate 	free((*set)->elements[i].elements);
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate     free((*set)->elements);
547c478bd9Sstevel@tonic-gate     free(*set);
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate     *set = GSS_C_NULL_OID_SET;
57*1da57d55SToomas Soome 
587c478bd9Sstevel@tonic-gate     return(GSS_S_COMPLETE);
597c478bd9Sstevel@tonic-gate }
60