[Asterisk-code-review] res ari channels: Fix reference leak in channel state invalid. (asterisk[15])
Corey Farrell
asteriskteam at digium.com
Tue Oct 31 13:18:35 CDT 2017
Corey Farrell has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/6944/1
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index 6027a80..b87b46e 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_cleanup(snapshot);
+
return -1;
}
+ ao2_cleanup(snapshot);
+
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: newchange
Gerrit-Change-Id: I8c653f00416b39978513c5605c4be0f03b1df29a
Gerrit-Change-Number: 6944
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171031/973a9d47/attachment.html>
More information about the asterisk-code-review
mailing list