<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8152">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_sorcery_realtime.c: Fix ref leak if object failed to apply.<br><br>Change-Id: I3c7106ff77009754725cee790eadf5da44154ab6<br>---<br>M res/res_sorcery_realtime.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/8152/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c<br>index 9b0b25f..c74e1c1 100644<br>--- a/res/res_sorcery_realtime.c<br>+++ b/res/res_sorcery_realtime.c<br>@@ -178,6 +178,7 @@<br>   if (!id<br>               || !(object = ast_sorcery_alloc(sorcery, type, id->value))<br>                 || ast_sorcery_objectset_apply(sorcery, object, objectset)) {<br>+                ao2_cleanup(object);<br>          return NULL;<br>  }<br> <br>@@ -235,7 +236,9 @@<br> <br>          objectset = sorcery_realtime_filter_objectset(objectset, &id, sorcery, type);<br> <br>-         if (id && (object = ast_sorcery_alloc(sorcery, type, id->value)) && !ast_sorcery_objectset_apply(sorcery, object, objectset)) {<br>+           if (id<br>+                       && (object = ast_sorcery_alloc(sorcery, type, id->value))<br>+                 && !ast_sorcery_objectset_apply(sorcery, object, objectset)) {<br>                        ao2_link(objects, object);<br>            }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8152">change 8152</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/8152"/><meta itemprop="name" content="View Change"/></div></div>

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