<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6707">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cdr.c: Replace redundant check with an ast_assert()<br><br>The only caller of cdr_object_fn_table.process_party_b() explicitly does<br>the check before calling.<br><br>Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618<br>---<br>M main/cdr.c<br>1 file changed, 5 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/6707/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/cdr.c b/main/cdr.c<br>index 4bcfc05..f313f0b 100644<br>--- a/main/cdr.c<br>+++ b/main/cdr.c<br>@@ -1626,11 +1626,9 @@<br> static void dial_state_process_party_b(struct cdr_object *cdr, struct ast_channel_snapshot *snapshot)<br> {<br> ast_assert(snapshot != NULL);<br>+ ast_assert(cdr->party_b.snapshot<br>+ && !strcasecmp(cdr->party_b.snapshot->name, snapshot->name));<br> <br>- if (!cdr->party_b.snapshot<br>- || strcasecmp(cdr->party_b.snapshot->name, snapshot->name)) {<br>- return;<br>- }<br> cdr_object_swap_snapshot(&cdr->party_b, snapshot);<br> <br> /* If party B hangs up, finalize this CDR */<br>@@ -1826,10 +1824,9 @@<br> <br> static void bridge_state_process_party_b(struct cdr_object *cdr, struct ast_channel_snapshot *snapshot)<br> {<br>- if (!cdr->party_b.snapshot<br>- || strcasecmp(cdr->party_b.snapshot->name, snapshot->name)) {<br>- return;<br>- }<br>+ ast_assert(cdr->party_b.snapshot<br>+ && !strcasecmp(cdr->party_b.snapshot->name, snapshot->name));<br>+<br> cdr_object_swap_snapshot(&cdr->party_b, snapshot);<br> <br> /* If party B hangs up, finalize this CDR */<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6707">change 6707</a>. To unsubscribe, 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/6707"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618 </div>
<div style="display:none"> Gerrit-Change-Number: 6707 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>