xref: /freebsd/crypto/krb5/doc/doxy_examples/cc_unique.c (revision b670c9bafc0e31c7609969bf374b2e80bdc00211)
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
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