]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Move return code checks closer to where the return codes are set
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 7 Nov 2023 03:22:41 +0000 (16:22 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 7 Nov 2023 21:54:32 +0000 (21:54 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/pac-glue.c

index 21e8acf6e00fe1eff4167562a0d92720642824fd..abd6d138af16226d7de37663dcd5a9554731c47a 100644 (file)
@@ -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;
+                       }
                }
        }