diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 21e8acf6e00..abd6d138af1 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -2933,6 +2933,9 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx, new_pac, type, (type_data.data != NULL) ? &type_data : &null_data); + if (code != 0) { + goto done; + } } else { code = krb5_pac_get_buffer(context, client.pac, @@ -2950,10 +2953,9 @@ krb5_error_code samba_kdc_update_pac(TALLOC_CTX *mem_ctx, type, (type_data.data != NULL) ? &type_data : &null_data); smb_krb5_free_data_contents(context, &type_data); - } - - if (code != 0) { - goto done; + if (code != 0) { + goto done; + } } }