[Asterisk-code-review] app_mixmonitor: cleanup datastore when monitor thread fails to launch (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Mon Jan 4 14:43:59 CST 2021


Attention is currently required from: Kevin Harwell.
Hello Friendly Automation, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/c/asterisk/+/15235

to look at the new patch set (#2).

Change subject: app_mixmonitor: cleanup datastore when monitor thread fails to launch
......................................................................

app_mixmonitor: cleanup datastore when monitor thread fails to launch

launch_monitor_thread is responsible for creating and initializing
the mixmonitor, and dependent data structures. There was one off
nominal path after the datastore gets created that triggers when
the channel being monitored is hung up prior to monitor starting
itself.

If this happened the monitor thread would not "launch", and the
mixmonitor object and associated objects are freed, including the
underlying datastore data object. However, the datastore itself was
not removed from the channel, so when the channel eventually gets
destroyed it tries to access the previously freed datastore data
and crashes.

This patch removes and frees datastore object itself from the channel
before freeing the mixmonitor object thus ensuring the channel does
not call it when destroyed.

ASTERISK-28947 #close

Change-Id: Id4f9e958956d62473ed5ff06c98ae3436e839ff8
---
M apps/app_mixmonitor.c
1 file changed, 22 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/35/15235/2
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15235
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Id4f9e958956d62473ed5ff06c98ae3436e839ff8
Gerrit-Change-Number: 15235
Gerrit-PatchSet: 2
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-CC: Sean Bright <sean.bright at gmail.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210104/f43e04e4/attachment.html>


More information about the asterisk-code-review mailing list