Skip to content

memory leak on temporary of struct imessaging_post_state and struct tevent_immediate on struct imessaging_context (in rpcd_spoolss and maybe others) (bug #15201)

Stefan Metzmacher requested to merge samba-team/devel/samba:metze-auth into master

In many places we use imessaging_init() or imessaging_client_init() to create a temporary struct imessaging_context and in most places we use a temporary tevent_context.

In that case any message the process receives gets queued up on the temporary tevent contexts, see imessaging_dgm_recv() and imessaging_post_self().

As these temporary tevent contexts never run tevent_loop_once(), they'll never reach imessaging_post_handler() and the struct imessaging_post_state and struct tevent_immediate per message stay forever.


  • Commits have Signed-off-by: with name/author being identical to the commit author
  • (optional) This MR is just one part towards a larger feature.
  • (optional, if backport required) Bugzilla bug filed and BUG: tag added
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code

Merge request reports