mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user