]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpcclient: Goto done in cmd_samr_setuserinfo_int()
authorAndreas Schneider <asn@samba.org>
Thu, 19 Aug 2021 10:09:28 +0000 (12:09 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 18 Jul 2022 21:21:59 +0000 (21:21 +0000)
We need to free the frame or we will run into:
    smb_panic (why=0x7fa8c511aa88 "Frame not freed in order.")

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15124

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul 18 21:21:59 UTC 2022 on sn-devel-184

source3/rpcclient/cmd_samr.c

index eb7f7fc8424b9644d342d10e7e99796bbb2e627e..a048a4f935ebe7d016fe0b8c1865858f2b393386 100644 (file)
@@ -3296,7 +3296,8 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
 
                break;
        default:
-               return NT_STATUS_INVALID_INFO_CLASS;
+               status = NT_STATUS_INVALID_INFO_CLASS;
+               goto done;
        }
 
        /* Get sam policy handle */
@@ -3356,16 +3357,19 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
                                                 &types,
                                                 &result);
                if (!NT_STATUS_IS_OK(status)) {
-                       return status;
+                       goto done;
                }
                if (!NT_STATUS_IS_OK(result)) {
-                       return result;
+                       status = result;
+                       goto done;
                }
                if (rids.count != 1) {
-                       return NT_STATUS_INVALID_NETWORK_RESPONSE;
+                       status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+                       goto done;
                }
                if (types.count != 1) {
-                       return NT_STATUS_INVALID_NETWORK_RESPONSE;
+                       status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+                       goto done;
                }
 
                status = dcerpc_samr_OpenUser(b, frame,
@@ -3375,10 +3379,11 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
                                              &user_pol,
                                              &result);
                if (!NT_STATUS_IS_OK(status)) {
-                       return status;
+                       goto done;
                }
                if (!NT_STATUS_IS_OK(result)) {
-                       return result;
+                       status = result;
+                       goto done;
                }
        }
 
@@ -3398,7 +3403,8 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
                                                  &result);
                break;
        default:
-               return NT_STATUS_INVALID_PARAMETER;
+               status = NT_STATUS_INVALID_PARAMETER;
+               goto done;
        }
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("status: %s\n", nt_errstr(status)));