<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8154">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/54/8154/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 29fbeb9..1010340 100644<br>--- a/res/res_sorcery_realtime.c<br>+++ b/res/res_sorcery_realtime.c<br>@@ -176,6 +176,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>@@ -233,7 +234,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/8154">change 8154</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/8154"/><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: I3c7106ff77009754725cee790eadf5da44154ab6 </div>
<div style="display:none"> Gerrit-Change-Number: 8154 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>