krb5: FAST: Fix potential double-free

Coverity incorrectly thinks this is a NULL dereference after NULL check,
but it's not.  If anything, this could be a double-free.
This commit is contained in:
Nicolas Williams
2022-01-17 11:22:19 -06:00
parent fc42ff0212
commit 5c68a02407

View File

@@ -225,6 +225,8 @@ make_fast_ap_fxarmor(krb5_context context,
KrbFastArmor *fxarmor = NULL;
krb5_error_code ret;
*armor = NULL;
ALLOC(fxarmor, 1);
if (fxarmor == NULL) {
ret = ENOMEM;
@@ -429,6 +431,7 @@ _krb5_fast_create_armor(krb5_context context,
if (state->armor_data) {
free_KrbFastArmor(state->armor_data);
free(state->armor_data);
state->armor_data = NULL;
}
ret = make_fast_ap_fxarmor(context, state, realm,
&state->armor_data);