xref: /illumos-gate/usr/src/lib/krb5/kadm5/srv/svr_misc_free.c (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
1 /*
2  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3  *
4  *	Openvision retains the copyright to derivative works of
5  *	this source code.  Do *NOT* create a derivative of this
6  *	source code before consulting with your legal department.
7  *	Do *NOT* integrate *ANY* of this source code into another
8  *	product before consulting with your legal department.
9  *
10  *	For further information, read the top-level Openvision
11  *	copyright which is contained in the top-level MIT Kerberos
12  *	copyright.
13  *
14  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
15  *
16  */
17 
18 
19 /*
20  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
21  *
22  * $Header$
23  *
24  */
25 
26 #if !defined(lint) && !defined(__CODECENTER__)
27 static char *rcsid = "$Header$";
28 #endif
29 #include	<kadm5/admin.h>
30 #include	<stdlib.h>
31 #include	"server_internal.h"
32 
33 kadm5_ret_t
34 kadm5_free_principal_ent(void *server_handle,
35 			      kadm5_principal_ent_t val)
36 {
37     kadm5_server_handle_t	handle = server_handle;
38 
39     CHECK_HANDLE(server_handle);
40 
41     if(val) {
42 	if(val->principal)
43 	    krb5_free_principal(handle->context, val->principal);
44 	if(val->mod_name)
45 	    krb5_free_principal(handle->context, val->mod_name);
46 	if(val->policy)
47 	    free(val->policy);
48 
49 	/* XXX free key_data and tl_data */
50 
51 	if (handle->api_version == KADM5_API_VERSION_1)
52 	     free(val);
53     }
54     return KADM5_OK;
55 }
56