1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5
6 #pragma ident "@(#)g_rel_name.c 1.12 04/09/08 SMI"
7
8 /*
9 * glue routine for gss_release_name
10 */
11
12 #include <mechglueP.h>
13 #include <stdio.h>
14 #ifdef HAVE_STDLIB_H
15 #include <stdlib.h>
16 #endif
17 #include <string.h>
18
19 OM_uint32
20 gss_release_name(minor_status,
21 input_name)
22
23 OM_uint32 *minor_status;
24 gss_name_t *input_name;
25
26 {
27 gss_union_name_t union_name;
28
29 /* if input_name is NULL, return error */
30
31 if (input_name == 0)
32 return (GSS_S_BAD_NAME);
33
34 /*
35 * free up the space for the external_name and then
36 * free the union_name descriptor
37 */
38
39 union_name = (gss_union_name_t)*input_name;
40 *input_name = 0;
41 *minor_status = 0;
42
43 if (union_name == NULL)
44 return (GSS_S_BAD_NAME);
45
46 if (union_name->name_type)
47 (void) gss_release_oid(minor_status, &union_name->name_type);
48
49 free(union_name->external_name->value);
50 free(union_name->external_name);
51
52 if (union_name->mech_type) {
53 (void) __gss_release_internal_name(minor_status,
54 union_name->mech_type,
55 &union_name->mech_name);
56 (void) gss_release_oid(minor_status, &union_name->mech_type);
57 }
58
59 free(union_name);
60
61 return (GSS_S_COMPLETE);
62 }
|
1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5
6 #pragma ident "@(#)g_rel_name.c 1.11 04/02/23 SMI"
7
8 /*
9 * glue routine for gss_release_name
10 */
11
12 #include <mechglueP.h>
13 #include <stdio.h>
14 #ifdef HAVE_STDLIB_H
15 #include <stdlib.h>
16 #endif
17 #include <string.h>
18
19 OM_uint32
20 gss_release_name(minor_status,
21 input_name)
22
23 OM_uint32 *minor_status;
24 gss_name_t *input_name;
25
26 {
27 gss_union_name_t union_name;
28
29 if (minor_status == NULL)
30 return (GSS_S_CALL_INACCESSIBLE_WRITE);
31 *minor_status = 0;
32
33 /* if input_name is NULL, return error */
34 if (input_name == 0)
35 return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME);
36
37 /*
38 * free up the space for the external_name and then
39 * free the union_name descriptor
40 */
41
42 union_name = (gss_union_name_t)*input_name;
43 *input_name = 0;
44 *minor_status = 0;
45
46 if (union_name->name_type)
47 (void) gss_release_oid(minor_status, &union_name->name_type);
48
49 free(union_name->external_name->value);
50 free(union_name->external_name);
51
52 if (union_name->mech_type) {
53 (void) __gss_release_internal_name(minor_status,
54 union_name->mech_type,
55 &union_name->mech_name);
56 (void) gss_release_oid(minor_status, &union_name->mech_type);
57 }
58
59 free(union_name);
60
61 return (GSS_S_COMPLETE);
62 }
|