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

Liviu Chircu noreply at github.com
Tue Apr 12 15:52:59 UTC 2022


  Branch: refs/heads/3.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: d2c4bebc4c90ce4fe5df12e7edde3eff6116a889
      https://github.com/OpenSIPS/opensips/commit/d2c4bebc4c90ce4fe5df12e7edde3eff6116a889
  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