[Asterisk-code-review] res ari channels: Fix reference leak in channel state invalid. (asterisk[15])
Jenkins2
asteriskteam at digium.com
Wed Nov 1 07:36:59 CDT 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6944 )
Change subject: res_ari_channels: Fix reference leak in channel_state_invalid.
......................................................................
res_ari_channels: Fix reference leak in channel_state_invalid.
channel_state_invalid leaked a reference to the channel snapshot any
time it was aquired.
ASTERISK-27067 #close
Change-Id: I8c653f00416b39978513c5605c4be0f03b1df29a
---
M res/ari/resource_channels.c
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index 6027a80..6b4f26c 100644
--- a/res/ari/resource_channels.c
+++ b/res/ari/resource_channels.c
@@ -99,9 +99,13 @@
|| snapshot->state == AST_STATE_RINGING) {
ast_ari_response_error(response, 412, "Precondition Failed",
"Channel in invalid state");
+ ao2_ref(snapshot, -1);
+
return -1;
}
+ ao2_ref(snapshot, -1);
+
return 0;
}
--
To view, visit https://gerrit.asterisk.org/6944
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I8c653f00416b39978513c5605c4be0f03b1df29a
Gerrit-Change-Number: 6944
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171101/f6583fb7/attachment.html>
More information about the asterisk-code-review
mailing list