s3:auth_samba4: make use of imessaging_init_discard_incoming()
authorStefan Metzmacher <metze@samba.org>
Wed, 28 Sep 2022 12:14:41 +0000 (14:14 +0200)
committerJule Anger <janger@samba.org>
Wed, 19 Oct 2022 08:40:14 +0000 (08:40 +0000)
Otherwise we'll generate a memory leak of imessaging_post_state/
tevent_immediate structures per incoming message!

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 32df5e4961cf064b72bb496157cc6092126d9b8e)

source3/auth/auth_samba4.c

index ff8dc94d2960fc63aa0fe499c85d75aafafc278d..6c017ef4aa30dd9d88200a9c20592cfca7e123a8 100644 (file)
@@ -241,12 +241,12 @@ static NTSTATUS prepare_gensec(const struct auth_context *auth_context,
                return NT_STATUS_INVALID_SERVER_STATE;
        }
 
-       msg_ctx = imessaging_init(frame,
+       msg_ctx = imessaging_init_discard_incoming(frame,
                                  lp_ctx,
                                  *server_id,
                                  event_ctx);
        if (msg_ctx == NULL) {
-               DEBUG(1, ("imessaging_init failed\n"));
+               DEBUG(1, ("imessaging_init_discard_incoming failed\n"));
                TALLOC_FREE(frame);
                return NT_STATUS_INVALID_SERVER_STATE;
        }
@@ -324,12 +324,12 @@ static NTSTATUS make_auth4_context_s4(const struct auth_context *auth_context,
                return NT_STATUS_INVALID_SERVER_STATE;
        }
 
-       msg_ctx = imessaging_init(frame,
+       msg_ctx = imessaging_init_discard_incoming(frame,
                                  lp_ctx,
                                  *server_id,
                                  event_ctx);
        if (msg_ctx == NULL) {
-               DEBUG(1, ("imessaging_init failed\n"));
+               DEBUG(1, ("imessaging_init_discard_incoming failed\n"));
                TALLOC_FREE(frame);
                return NT_STATUS_INVALID_SERVER_STATE;
        }