Add guard in krb5_free_creds()

Don't call krb5_free_contents() if the creds pointer is NULL.

MIT krb5 also has this guard.
This commit is contained in:
Nicolas Williams
2015-03-24 11:47:58 -05:00
parent 902aa4ee02
commit a1c87df260

View File

@@ -160,8 +160,9 @@ krb5_copy_creds (krb5_context context,
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_free_creds (krb5_context context, krb5_creds *c)
{
krb5_free_cred_contents (context, c);
free (c);
if (c != NULL)
krb5_free_cred_contents(context, c);
free(c);
return 0;
}