<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7916">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_cache: Remove silly usage of RAII_VAR.<br><br>Change-Id: Ifa95e5801c949df296c7e4376347730fb0ed52ef<br>---<br>M main/stasis_cache.c<br>1 file changed, 11 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/stasis_cache.c b/main/stasis_cache.c<br>index 3bcf0c4..ca17bdd 100644<br>--- a/main/stasis_cache.c<br>+++ b/main/stasis_cache.c<br>@@ -868,9 +868,8 @@<br> <br> struct stasis_caching_topic *stasis_caching_topic_create(struct stasis_topic *original_topic, struct stasis_cache *cache)<br> {<br>-       RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);<br>-   struct stasis_subscription *sub;<br>-     RAII_VAR(char *, new_name, NULL, ast_free);<br>+  struct stasis_caching_topic *caching_topic;<br>+  char *new_name;<br>       int ret;<br> <br>   ret = ast_asprintf(&new_name, "%s-cached", stasis_topic_name(original_topic));<br>@@ -881,28 +880,31 @@<br>   caching_topic = ao2_alloc_options(sizeof(*caching_topic),<br>             stasis_caching_topic_dtor, AO2_ALLOC_OPT_LOCK_NOLOCK);<br>        if (caching_topic == NULL) {<br>+         ast_free(new_name);<br>+<br>                return NULL;<br>  }<br> <br>  caching_topic->topic = stasis_topic_create(new_name);<br>+     ast_free(new_name);<br>   if (caching_topic->topic == NULL) {<br>+               ao2_ref(caching_topic, -1);<br>+<br>                return NULL;<br>  }<br> <br>  ao2_ref(cache, +1);<br>   caching_topic->cache = cache;<br> <br>-  sub = internal_stasis_subscribe(original_topic, caching_topic_exec, caching_topic, 0, 0);<br>-    if (sub == NULL) {<br>+   caching_topic->sub = internal_stasis_subscribe(original_topic, caching_topic_exec, caching_topic, 0, 0);<br>+  if (caching_topic->sub == NULL) {<br>+         ao2_ref(caching_topic, -1);<br>+<br>                return NULL;<br>  }<br> <br>  ao2_ref(original_topic, +1);<br>  caching_topic->original_topic = original_topic;<br>-<br>-        /* This is for the reference contained in the subscription above */<br>-  ao2_ref(caching_topic, +1);<br>-  caching_topic->sub = sub;<br> <br>       /* The subscription holds the reference, so no additional ref bump. */<br>        return caching_topic;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7916">change 7916</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/7916"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ifa95e5801c949df296c7e4376347730fb0ed52ef </div>
<div style="display:none"> Gerrit-Change-Number: 7916 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>