Blame src/lib/gssapi/generic/rel_oid_set.c

Packit fd8b60
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
Packit fd8b60
/* #ident  "@(#)gss_release_oid_set.c 1.12     95/08/23 SMI" */
Packit fd8b60
Packit fd8b60
/*
Packit fd8b60
 * Copyright 1996 by Sun Microsystems, Inc.
Packit fd8b60
 *
Packit fd8b60
 * Permission to use, copy, modify, distribute, and sell this software
Packit fd8b60
 * and its documentation for any purpose is hereby granted without fee,
Packit fd8b60
 * provided that the above copyright notice appears in all copies and
Packit fd8b60
 * that both that copyright notice and this permission notice appear in
Packit fd8b60
 * supporting documentation, and that the name of Sun Microsystems not be used
Packit fd8b60
 * in advertising or publicity pertaining to distribution of the software
Packit fd8b60
 * without specific, written prior permission. Sun Microsystems makes no
Packit fd8b60
 * representations about the suitability of this software for any
Packit fd8b60
 * purpose.  It is provided "as is" without express or implied warranty.
Packit fd8b60
 *
Packit fd8b60
 * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit fd8b60
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit fd8b60
 * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit fd8b60
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
Packit fd8b60
 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
Packit fd8b60
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit fd8b60
 * PERFORMANCE OF THIS SOFTWARE.
Packit fd8b60
 */
Packit fd8b60
Packit fd8b60
/*
Packit fd8b60
 *  glue routine for gss_release_oid_set
Packit fd8b60
 */
Packit fd8b60
Packit fd8b60
#include "gssapiP_generic.h"
Packit fd8b60
Packit fd8b60
#include <stdio.h>
Packit fd8b60
#ifdef HAVE_STDLIB_H
Packit fd8b60
#include <stdlib.h>
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
OM_uint32
Packit fd8b60
generic_gss_release_oid_set(
Packit fd8b60
    OM_uint32 *minor_status,
Packit fd8b60
    gss_OID_set *set)
Packit fd8b60
{
Packit fd8b60
    size_t i;
Packit fd8b60
    if (minor_status)
Packit fd8b60
        *minor_status = 0;
Packit fd8b60
Packit fd8b60
    if (set == NULL)
Packit fd8b60
        return(GSS_S_COMPLETE);
Packit fd8b60
Packit fd8b60
    if (*set == GSS_C_NULL_OID_SET)
Packit fd8b60
        return(GSS_S_COMPLETE);
Packit fd8b60
Packit fd8b60
    for (i=0; i<(*set)->count; i++)
Packit fd8b60
        gssalloc_free((*set)->elements[i].elements);
Packit fd8b60
Packit fd8b60
    gssalloc_free((*set)->elements);
Packit fd8b60
    gssalloc_free(*set);
Packit fd8b60
Packit fd8b60
    *set = GSS_C_NULL_OID_SET;
Packit fd8b60
Packit fd8b60
    return(GSS_S_COMPLETE);
Packit fd8b60
}