freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

Memory leak when some modules are unloaded

Open yois615 opened this issue 3 years ago • 0 comments

Describe the bug Modules that use SWITCH_CONFIG_ITEM_STRING_STRDUP to read config options are not properly freed at module unload.

To Reproduce Steps to reproduce the behavior:

  1. enable mod_cidlookup (affected example)
  2. Add a url parameter to autoload_configs/cidlookup.conf.xml
  3. compile with ASAN
  4. start and stop freeswitch in interactive mode
  5. ASAN shows memory leaks from switch_xml_config.c:314

Expected behavior Memory is freed when module is unloaded

Package version or git hash

  • Version [e.g. 1.10.7]

There seem to be two reasons that this is happening:

  1. mod_cidlookup doesn't include switch_xml_config_cleanup in its shutdown macro
  2. switch_xml_config_cleanup contains an if statement requiring string_options that may not exist.

yois615 avatar Aug 09 '22 05:08 yois615