1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

s4:kdc: Use common out path in mit_samba_kpasswd_change_password()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-08-11 10:23:10 +12:00 committed by Andrew Bartlett
parent ab098c2431
commit 9d485b262a

View File

@ -1093,8 +1093,8 @@ int mit_samba_kpasswd_change_password(struct mit_samba_context *ctx,
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("samba_kdc_get_user_info_from_db failed: %s\n", DBG_WARNING("samba_kdc_get_user_info_from_db failed: %s\n",
nt_errstr(status)); nt_errstr(status));
talloc_free(tmp_ctx); code = EINVAL;
return EINVAL; goto out;
} }
status = auth_generate_session_info(tmp_ctx, 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)) { if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("auth_generate_session_info failed: %s\n", DBG_WARNING("auth_generate_session_info failed: %s\n",
nt_errstr(status)); nt_errstr(status));
talloc_free(tmp_ctx); code = EINVAL;
return EINVAL; goto out;
} }
/* password is expected as UTF16 */ /* password is expected as UTF16 */
@ -1117,8 +1117,8 @@ int mit_samba_kpasswd_change_password(struct mit_samba_context *ctx,
pwd, strlen(pwd), pwd, strlen(pwd),
&password.data, &password.length)) { &password.data, &password.length)) {
DBG_WARNING("convert_string_talloc failed\n"); DBG_WARNING("convert_string_talloc failed\n");
talloc_free(tmp_ctx); code = EINVAL;
return EINVAL; goto out;
} }
status = samdb_kpasswd_change_password(tmp_ctx, status = samdb_kpasswd_change_password(tmp_ctx,