]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: Remove event context on failure
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 5 Oct 2023 22:04:06 +0000 (11:04 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/kerberos/kerberos_util.c

index dce71552e9acedc57f85760faca3305ce9924fb1..40ec0e0bc2a8e4ca55846c55d7f08eb25864d400 100644 (file)
@@ -363,6 +363,9 @@ done:
                        talloc_free(mem_ctx);
                        (*error_string) = "INTERNAL error: Cannot impersonate principal with just a keyblock.  A password must be specified in the credentials";
                        krb5_get_init_creds_opt_free(smb_krb5_context->krb5_context, krb_options);
+#ifdef SAMBA4_USES_HEIMDAL
+                       smb_krb5_context_remove_event_ctx(smb_krb5_context, previous_ev, event_ctx);
+#endif
                        return EINVAL;
                } else {
                        /* No password available, try to use a keyblock instead */