/* This function tries to get tickets and put them in the specified
cache, however, if the cache does not exist, it may choose to put
them elsewhere (ie: the system default) so we set that here */
- if (strcmp (krb5_cc_default_name (context), outCacheName) != 0) {
+ char * ccdefname = krb5_cc_default_name (context);
+ if (!ccdefname || strcmp (ccdefname, outCacheName) != 0) {
krb5_cc_set_default_name (context, outCacheName);
}
KLDisposeString (outCacheName);
char ccname[256]="";
pLeash_AcquireInitialTicketsIfNeeded(context, NULL, ccname, sizeof(ccname));
if (ccname[0]) {
- if (strcmp (krb5_cc_default_name (context),ccname) != 0) {
+ char * ccdefname = krb5_cc_default_name (context);
+ if (!ccdefname || strcmp (ccdefname, ccname) != 0) {
krb5_cc_set_default_name (context, ccname);
}
}