<p>Kevin Harwell <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17493">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Kevin Harwell: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_morsecode: Fix deadlock<br><br>Fixes a deadlock in app_morsecode caused by locking<br>the channel twice when reading variables from the<br>channel. The duplicate lock is simply removed.<br><br>ASTERISK-29744 #close<br><br>Change-Id: I204000701f123361d7f85e0498fedc90243c75e4<br>---<br>M apps/app_morsecode.c<br>1 file changed, 1 insertion(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_morsecode.c b/apps/app_morsecode.c</span><br><span>index 995eb70..f9b2119 100644</span><br><span>--- a/apps/app_morsecode.c</span><br><span>+++ b/apps/app_morsecode.c</span><br><span>@@ -197,14 +197,12 @@</span><br><span>    }</span><br><span> </span><br><span>        /* Use variable MORSETONE, if set (else 800) */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_lock(chan);</span><br><span>      tonec = pbx_builtin_getvar_helper(chan, "MORSETONE");</span><br><span>      if (ast_strlen_zero(tonec) || (sscanf(tonec, "%30d", &tone) != 1)) {</span><br><span>           tone = 800;</span><br><span>  }</span><br><span> </span><br><span>        /* Use variable MORSESPACETONE, if set (else 0) */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>   toneb = pbx_builtin_getvar_helper(chan, "MORSESPACETONE");</span><br><span>         if (ast_strlen_zero(toneb) || (sscanf(toneb, "%30d", &toneoff) != 1)) {</span><br><span>                toneoff = 0;</span><br><span>@@ -216,8 +214,8 @@</span><br><span>           codetype = "INTERNATIONAL";</span><br><span>        }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_unlock(chan);</span><br><span>    if (!strcmp(codetype, "AMERICAN")) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_channel_unlock(chan);</span><br><span>            for (digit = data; *digit; digit++) {</span><br><span>                        const char *dahdit;</span><br><span>                  digit2 = *digit;</span><br><span>@@ -252,7 +250,6 @@</span><br><span>                               break;</span><br><span>               }</span><br><span>    } else { /* International */</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_channel_unlock(chan);</span><br><span>            for (digit = data; *digit; digit++) {</span><br><span>                        const char *dahdit;</span><br><span>                  digit2 = *digit;</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17493">change 17493</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/17493"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I204000701f123361d7f85e0498fedc90243c75e4 </div>
<div style="display:none"> Gerrit-Change-Number: 17493 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>