From: Joseph Sutton Date: Thu, 10 Aug 2023 22:23:10 +0000 (+1200) Subject: s4:kdc: Use common out path in mit_samba_kpasswd_change_password() X-Git-Tag: tevent-0.16.0~980 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d485b262a57439dfba6deff5e8c4fb7023a5d1f;p=thirdparty%2Fsamba.git s4:kdc: Use common out path in mit_samba_kpasswd_change_password() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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,