]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Use common out path in mit_samba_kpasswd_change_password()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 10 Aug 2023 22:23:10 +0000 (10:23 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 14 Aug 2023 04:57:34 +0000 (04:57 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/mit_samba.c

index 2ca21fa59ed0592d43188f68048db7c74aef0cee..7b6158f1ed7080764bd7a1c1df368d46f11fd485 100644 (file)
@@ -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,