6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / uts / common / gssapi / gss_release_name.c
blob23c824eb685fed4f3c0832b2b61913bc2101abea
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright (c) 1996,1997, by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * glue routine for gss_release_name
33 #include "mechglueP.h"
35 OM_uint32
36 gss_release_name(OM_uint32 *minor_status, gss_name_t *input_name)
38 gss_union_name_t union_name;
40 /* if input_name is NULL, return error */
42 if (input_name == 0)
43 return (GSS_S_BAD_NAME);
46 * free up the space for the external_name, name_type
47 * and then free the union_name descriptor
49 union_name = (gss_union_name_t) *input_name;
50 *input_name = 0;
51 *minor_status = 0;
53 if (union_name == NULL)
54 return (GSS_S_BAD_NAME);
56 FREE(union_name->external_name->value,
57 union_name->external_name->length);
58 FREE(union_name->external_name, sizeof (gss_buffer_desc));
60 /* free the name_type */
61 FREE(union_name->name_type->elements, union_name->name_type->length);
62 FREE(union_name->name_type, sizeof (gss_OID_desc));
64 FREE(union_name, sizeof (gss_union_name_desc));
66 return (GSS_S_COMPLETE);