[OpenSIPS-Devel] [OpenSIPS/opensips] 1b246e: Fix global msg context leakage in error_route

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


  Branch: refs/heads/3.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 1b246e4dd9d7b9ff1c75fe1c85b1bc036a330deb
      https://github.com/OpenSIPS/opensips/commit/1b246e4dd9d7b9ff1c75fe1c85b1bc036a330deb
  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: 48ad5f6fc4579aff0e2b08937a1905c8511f08c6
      https://github.com/OpenSIPS/opensips/commit/48ad5f6fc4579aff0e2b08937a1905c8511f08c6
  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/15c83fd7b33a...48ad5f6fc457



More information about the Devel mailing list