[Asterisk-code-review] res sorcery realtime.c: Fix ref leak if object failed to apply. (asterisk[master])
Jenkins2
asteriskteam at digium.com
Mon Feb 5 13:05:40 CST 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8154 )
Change subject: res_sorcery_realtime.c: Fix ref leak if object failed to apply.
......................................................................
res_sorcery_realtime.c: Fix ref leak if object failed to apply.
Change-Id: I3c7106ff77009754725cee790eadf5da44154ab6
---
M res/res_sorcery_realtime.c
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Sean Bright: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index 29fbeb9..1010340 100644
--- a/res/res_sorcery_realtime.c
+++ b/res/res_sorcery_realtime.c
@@ -176,6 +176,7 @@
if (!id
|| !(object = ast_sorcery_alloc(sorcery, type, id->value))
|| ast_sorcery_objectset_apply(sorcery, object, objectset)) {
+ ao2_cleanup(object);
return NULL;
}
@@ -233,7 +234,9 @@
objectset = sorcery_realtime_filter_objectset(objectset, &id, sorcery, type);
- if (id && (object = ast_sorcery_alloc(sorcery, type, id->value)) && !ast_sorcery_objectset_apply(sorcery, object, objectset)) {
+ if (id
+ && (object = ast_sorcery_alloc(sorcery, type, id->value))
+ && !ast_sorcery_objectset_apply(sorcery, object, objectset)) {
ao2_link(objects, object);
}
--
To view, visit https://gerrit.asterisk.org/8154
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3c7106ff77009754725cee790eadf5da44154ab6
Gerrit-Change-Number: 8154
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180205/a492dec3/attachment-0001.html>
More information about the asterisk-code-review
mailing list