]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: always clear filter_subreq in smb2srv_client_mc_negprot_next()
authorStefan Metzmacher <metze@samba.org>
Thu, 3 Aug 2023 13:34:29 +0000 (15:34 +0200)
committerJule Anger <janger@samba.org>
Tue, 15 Aug 2023 08:00:08 +0000 (08:00 +0000)
Commit 5d66d5b84f87267243dcd5223210906ce589af91 introduced a
'verify_again:' target, if we ever hit that, we would leak
the existing filter_subreq.

Moving it just above a possible messaging_filtered_read_send()
will allow us to only clear it if we actually create a new
request. That will help us in the next commits.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 50d61e5300250922bf36bb699306f82dff6a00b9)

source3/smbd/smbXsrv_client.c

index f57bc724910d0ccf384aa0f9fd4cc4140cf3c256..4d3fe30f812b181363f936a79d276b6e08530569 100644 (file)
@@ -554,7 +554,6 @@ static void smb2srv_client_mc_negprot_next(struct tevent_req *req)
        uint32_t seqnum = 0;
        struct server_id last_server_id = { .pid = 0, };
 
-       TALLOC_FREE(state->filter_subreq);
        SMB_ASSERT(state->db_rec == NULL);
        state->db_rec = smbXsrv_client_global_fetch_locked(table->global.db_ctx,
                                                           &client_guid,
@@ -635,6 +634,7 @@ verify_again:
        SMB_ASSERT(last_server_id.pid == 0);
        last_server_id = global->server_id;
 
+       TALLOC_FREE(state->filter_subreq);
        if (procid_is_local(&global->server_id)) {
                subreq = messaging_filtered_read_send(state,
                                                      state->ev,