[OpenSIPS-Devel] [OpenSIPS/opensips] 1dde47: siprec: fix memory leaking while setting the same ...

Răzvan Crainea noreply at github.com
Wed Sep 27 15:04:37 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 1dde47b524e4bb27e992ede2b15631eb12092537
      https://github.com/OpenSIPS/opensips/commit/1dde47b524e4bb27e992ede2b15631eb12092537
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M modules/siprec/siprec_var.c

  Log Message:
  -----------
  siprec: fix memory leaking while setting the same field of siprec var

Credits go to Rob Moore, Daniel Bryars and Steven Ayre from Dubber, as
well as Liviu Chircu from the OpenSIPS team for working together to spot
this leak.


  Commit: 41aa549a5f37fb09073fa8cb8e79f8673d40ae76
      https://github.com/OpenSIPS/opensips/commit/41aa549a5f37fb09073fa8cb8e79f8673d40ae76
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M main.c

  Log Message:
  -----------
  main: avoid 'for' loop initial declarations in C98

This would break rpm build on CentOS 7 due to old compiler/standard


  Commit: 4640465215f131592326363bd0748d9f0e79f04d
      https://github.com/OpenSIPS/opensips/commit/4640465215f131592326363bd0748d9f0e79f04d
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M statistics.c

  Log Message:
  -----------
  [WIP] statistics: fix crash when creating a series stat

Under normal circumstances, when a statistic is updated, we first search
whether it exists, and if not, we add it to the statistics hash.
However, due to the way it is implemented, searching and adding a
statistic is not atomic, hence, with high concurrency, when adding a new
statistic, we might already find an existing one there. In this case,
the code tries to return that statistic in the `pvar` parameter -
however, that parameter might be a (r/o) function, hence a crash
happens. This commit fixes the crash. Close #3136

However, it returns 0, as if the statistic was properly added - the
problem with this approach is that from the caller's perspective, we do
not know whether the statistic was already there or not, to free the
existing structure - hence this might result into a leak. We are still
working on a solution for this.


Compare: https://github.com/OpenSIPS/opensips/compare/75605d539311...4640465215f1



More information about the Devel mailing list