[OpenSIPS-Devel] [OpenSIPS/opensips] 36bf27: re.subst transformation: Fix possible pkg memleak

Liviu Chircu noreply at github.com
Tue Apr 12 15:53:16 UTC 2022


  Branch: refs/heads/3.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 36bf2714712a18f9878e23bf27a090fbb476c263
      https://github.com/OpenSIPS/opensips/commit/36bf2714712a18f9878e23bf27a090fbb476c263
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M re.c

  Log Message:
  -----------
  re.subst transformation: Fix possible pkg memleak

The leak would only happen under these simultaneous conditions:
  1. the "subst" (last) part of the RE is a variable
  2. the variable is using an index (e.g. an AVP)
  3. there are at least two different "subst" strings in the script,
     which can run alternatively (see the global "subst_re" logic to
     understand more about the "reusage" mechanism and this effect)

Many thanks to Richard Revels for a detailed report on this bug!

Fixes #2761

(cherry picked from commit c739c2f4de2b26767e894765bb5f47d908f88603)





More information about the Devel mailing list