* $Author$
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
lose:
MAYBE_CLOSE(id, kret); /* won't overwrite kret
if already set */
- if (kret != KRB5_OK) {
- if (creds->client)
- krb5_free_principal(creds->client);
- if (creds->server)
- krb5_free_principal(creds->server);
- if (creds->keyblock.contents)
- xfree(creds->keyblock.contents);
- if (creds->ticket.data)
- xfree(creds->ticket.data);
- if (creds->second_ticket.data)
- xfree(creds->second_ticket.data);
- if (creds->addresses)
- krb5_free_address(creds->addresses);
- if (creds->authdata)
- krb5_free_authdata(creds->authdata);
- }
+ if (kret != KRB5_OK)
+ krb5_free_cred_contents(creds);
return kret;
}