diff options
author | Corey Farrell <git@cfware.com> | 2017-10-31 14:18:45 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-10-31 13:43:32 -0500 |
commit | f2175c5a393491d55bfdc914b990cec691139a30 (patch) | |
tree | b14a030dfbe4606fbaf97ac683478155ac32cb73 /res/ari | |
parent | 491c8054f237feda8ea0ab606ce032e9caf0fb27 (diff) |
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
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/resource_channels.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 6027a8059..6b4f26c25 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -99,9 +99,13 @@ static int channel_state_invalid(struct stasis_app_control *control, || 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; } |