krb5: allow NULL parameter to krb5_pac_free()

This commit is contained in:
Isaac Boukris
2021-09-19 15:04:14 +03:00
committed by Luke Howard
parent 2acc4508d9
commit b295167208
2 changed files with 3 additions and 2 deletions

View File

@@ -2285,8 +2285,7 @@ out:
free_EncTicketPart(&adtkt);
if (mspac)
krb5_pac_free(context, mspac);
krb5_pac_free(context, mspac);
return ret;
}

View File

@@ -441,6 +441,8 @@ krb5_pac_get_types(krb5_context context,
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
krb5_pac_free(krb5_context context, krb5_pac pac)
{
if (pac == NULL)
return;
krb5_data_free(&pac->data);
krb5_data_free(&pac->ticket_sign_data);
free(pac->pac);