From 9d485b262a57439dfba6deff5e8c4fb7023a5d1f Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 11 Aug 2023 10:23:10 +1200 Subject: [PATCH] s4:kdc: Use common out path in mit_samba_kpasswd_change_password() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/kdc/mit_samba.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source4/kdc/mit_samba.c b/source4/kdc/mit_samba.c index 2ca21fa59ed..7b6158f1ed7 100644 --- a/source4/kdc/mit_samba.c +++ b/source4/kdc/mit_samba.c @@ -1093,8 +1093,8 @@ int mit_samba_kpasswd_change_password(struct mit_samba_context *ctx, if (!NT_STATUS_IS_OK(status)) { DBG_WARNING("samba_kdc_get_user_info_from_db failed: %s\n", nt_errstr(status)); - talloc_free(tmp_ctx); - return EINVAL; + code = EINVAL; + goto out; } status = auth_generate_session_info(tmp_ctx, @@ -1107,8 +1107,8 @@ int mit_samba_kpasswd_change_password(struct mit_samba_context *ctx, if (!NT_STATUS_IS_OK(status)) { DBG_WARNING("auth_generate_session_info failed: %s\n", nt_errstr(status)); - talloc_free(tmp_ctx); - return EINVAL; + code = EINVAL; + goto out; } /* password is expected as UTF16 */ @@ -1117,8 +1117,8 @@ int mit_samba_kpasswd_change_password(struct mit_samba_context *ctx, pwd, strlen(pwd), &password.data, &password.length)) { DBG_WARNING("convert_string_talloc failed\n"); - talloc_free(tmp_ctx); - return EINVAL; + code = EINVAL; + goto out; } status = samdb_kpasswd_change_password(tmp_ctx,