xref: /freebsd/crypto/krb5/doc/doxy_examples/cc_unique.c (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /** @example  cc_unique.c
2  *
3  *  Usage example for krb5_cc_new_unique function
4  */
5 #include "k5-int.h"
6 
7 krb5_error_code
func(krb5_context context)8 func(krb5_context context)
9 {
10     krb5_error_code ret;
11     krb5_ccache ccache = NULL;
12 
13     ret = krb5_cc_new_unique(context, "MEMORY", NULL, &ccache);
14     if (ret){
15         ccache = NULL;
16         return ret;
17     }
18     /* do something */
19     if (ccache)
20         (void)krb5_cc_destroy(context, ccache);
21     return 0;
22 }
23 
24