[OpenSIPS-Devel] [OpenSIPS/opensips] 85207d: cfgutils: Fix SHM leak with re.subst and $shv() va...

Liviu Chircu noreply at github.com
Wed Jun 17 11:08:39 UTC 2026


  Branch: refs/heads/3.6
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 85207da3bbf4f1abe25f045786908ea4de20dd63
      https://github.com/OpenSIPS/opensips/commit/85207da3bbf4f1abe25f045786908ea4de20dd63
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    M modules/cfgutils/shvar.c
    M pvar.c
    M pvar.h
    M re.c

  Log Message:
  -----------
  cfgutils: Fix SHM leak with re.subst and $shv() variables

The re.subst transformation stores replacement-side PV specs by value inside
its cached subst_expr.  When the cached expression is replaced, the embedded
$shv() spec could leave behind its shared-memory pvv buffer.

This can be triggered with a dynamic substitution expression such as:

    $var(re) = "/^s=before/s=$shv(voip_sdp_session)\r/g";
    $var(sdp) = $(var(sdp){re.subst,$var(re)});

Track pvv ownership, mark $shv() buffers as SHM-owned, and release them when
freeing cached re.subst replacement specs.

Fixes #3872

(cherry picked from commit 09ec06179c8c40d034e8eb27fe814f15418f58b6)



To unsubscribe from these emails, change your notification settings at https://github.com/OpenSIPS/opensips/settings/notifications



More information about the Devel mailing list