summaryrefslogtreecommitdiffstats
path: root/doc/doxy_examples/cc_unique.c
blob: 0a03edb5250e7dee79195d5355c46ea65876e55e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/** @example  cc_unique.c
 *
 *  Usage example for krb5_cc_new_unique function
 */
#include "k5-int.h"

krb5_error_code
func(krb5_context context)
{
    krb5_error_code ret;
    krb5_ccache ccache = NULL;

    ret = krb5_cc_new_unique(context, "MEMORY", NULL, &ccache);
    if (ret){
        ccache = NULL; 
        return ret;
    }
    /* do something */
    if (ccache)
        (void)krb5_cc_destroy(context, ccache);
    return 0;
}