<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/5899">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer<br><br>Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3<br>---<br>M res/res_pjsip_mwi.c<br>1 file changed, 5 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/5899/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c<br>index f73f10c..cc4b40a 100644<br>--- a/res/res_pjsip_mwi.c<br>+++ b/res/res_pjsip_mwi.c<br>@@ -1235,8 +1235,8 @@<br>    const struct ast_sip_contact *contact = object;<br>       struct ao2_iterator *mwi_subs;<br>        struct mwi_subscription *mwi_sub;<br>-    RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);<br>-    RAII_VAR(struct ast_sip_contact *, found_contact, NULL, ao2_cleanup);<br>+        struct ast_sip_endpoint *endpoint = NULL;<br>+    struct ast_sip_contact *found_contact;<br> <br>     if (contact->endpoint) {<br>           endpoint = ao2_bump(contact->endpoint);<br>@@ -1247,12 +1247,15 @@<br>   }<br> <br>  if (!endpoint || ast_strlen_zero(endpoint->subscription.mwi.mailboxes)) {<br>+         ao2_cleanup(endpoint);<br>                return;<br>       }<br> <br>  /* Check if there is another contact */<br>       found_contact = ast_sip_location_retrieve_contact_from_aor_list(endpoint->aors);<br>+  ao2_cleanup(endpoint);<br>        if (found_contact) {<br>+         ao2_cleanup(found_contact);<br>           return;<br>       }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5899">change 5899</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/5899"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3 </div>
<div style="display:none"> Gerrit-Change-Number: 5899 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>