function that does the null check.
Also, use krb5_free_keyblock_contents instead of open-coding all the
work (and not trying hard enough to clear the memory).
ticket: 6377
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21926
dc483132-0cff-0310-8789-
dd5450dbe970
{
if (val == NULL)
return;
- if (val->contents)
- free(val->contents);
+ free(val->contents);
free(val);
}
val->client = 0;
krb5_free_principal(context, val->server);
val->server = 0;
- if (val->keyblock.contents) {
- memset(val->keyblock.contents, 0, val->keyblock.length);
- free(val->keyblock.contents);
- val->keyblock.contents = 0;
- }
+ krb5_free_keyblock_contents(context, &val->keyblock);
free(val->ticket.data);
val->ticket.data = 0;
free(val->second_ticket.data);