[sr-dev] [kamailio/kamailio] core/cfg has memory leak if string value is set (#2094)

mtirpak notifications at github.com
Wed Oct 9 17:07:40 CEST 2019


Daniel is right, the memory should be eventually freed when ALL the child processes update their local configuration, i.e. do at least one iteration of their loop and call cfg_update(). Each child process updates its local cfg pointer to the global one and travels through the pending callback list. Every item of this list can have a set of memory address to free. The last child that processes the change frees the memory.
Check cfg_update_local with the loop:
while (cfg_child_cb != last_cb) {...}
cfg_child_cb_free_item() frees the "replaced" strings.

The restriction is that none of the processes should be idle for a very long time. They should at least update the local config from time to time. This may not be always the case.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2094#issuecomment-540044623
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191009/a92ce0b6/attachment.html>


More information about the sr-dev mailing list