[OpenSIPS-Devel] [OpenSIPS/opensips] 6b6551: Fix global msg context leakage in error_route

Liviu Chircu noreply at github.com
Wed Oct 12 17:18:12 UTC 2022


  Branch: refs/heads/3.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 6b6551ac7694e354ee19f90952e7452be410afe0
      https://github.com/OpenSIPS/opensips/commit/6b6551ac7694e354ee19f90952e7452be410afe0
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M receive.c

  Log Message:
  -----------
  Fix global msg context leakage in error_route

While commit b5bcf046 fixed an issue with missing contexts during
error_route, it was missed that the "parse_error" label does *not* free
up the global context.

The effects of this bug were mostly hidden, affecting only opensips.cfg
scripts which employ the "error_route", causing a slow PKG memory leak,
proportional to the amount of bad SIP received.  Moreover, if these
scripts also use async(), they may occassionally run into a quick
abort() in t_resume_async(), due to a context being already set (BUG).

(cherry picked from commit 43ee34bbbb48cfcfe02217b03ef72726c01cc83e)


  Commit: 94b37404316da5148349c960336d5a9f68bc37ae
      https://github.com/OpenSIPS/opensips/commit/94b37404316da5148349c960336d5a9f68bc37ae
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M context.c
    M context.h

  Log Message:
  -----------
  context API: Fix ctx cleanup API; Document context_destroy() behavior

Although this patch fixes a memory leak in clear_global_context(), this
function is not being used at all.

(cherry picked from commit 02e1177714b91fa8b7e29f0162c8e9385767f6b1)


Compare: https://github.com/OpenSIPS/opensips/compare/fcd765665a30...94b37404316d



More information about the Devel mailing list