]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx_dundi.c: Misc memory management fixes when destroying peers
authorRichard Mudgett <rmudgett@digium.com>
Thu, 16 Aug 2018 02:31:45 +0000 (21:31 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 17 Aug 2018 19:44:13 +0000 (14:44 -0500)
commit4e43823d1994fadc833a6ede167f70ebcfece6be
tree5e8604f329b3333665cca1da89a03762bacb41c7
parent7d8e2389d6645071324f7459039733a2d816b6d1
pbx_dundi.c: Misc memory management fixes when destroying peers

* In destroy_peer(), fixed memory leaks of lookup history strings and
qualify transactions when destroying peers.

* In destroy_peer(), fixed leaving the registerexpire scheduled callback
active when a peer is destroyed on a reload.  The reload marks and sweeps
peers so any peers not explicitly configured get destroyed.  Peers created
dynamically from the '*' peer will not exist until they re-register after
the reload.  These destroyed peers caused memory corruption when the
registerexpire timer expired.

* Made build_peer() not schedule any callbacks on the '*' peer
(empty_eid).  It is a special peer that is cloned to dynamically created
peers so it doesn't actually get involved in any message transactions.

* Made do_register_expire() remove the dundi/dpeers AstDB entry when a
peer registration expires.

* Fix deep_copy_peer() to not copy some things that cannot be copied to
the cloned peer structure.  Timers, message transactions, and lookup
history are specific to a peer instance.

* Made set_config() lock around processing the mappings configuration.

* Reordered unload_module() to handle load_module() declining the load due
to error.

Change-Id: Ib846b2b60d027f3a2c2b3b563d9a83a357dce1d6
pbx/pbx_dundi.c