In krb5_authdata_context_init() I see: context = calloc(1, sizeof(*context)); if (kcontext == NULL) { code = ENOMEM; goto cleanup; } Seems wrong, no?