mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
res_pjsip_sdp_rtp fix leaking astobj2 ast_format
PR #700 added a preferred_format for the struct ast_rtp_codecs,
but when set the preferred_format it leaks an astobj2 ast_format.
In the next code
ast_rtp_codecs_set_preferred_format(&codecs, ast_format_cap_get_format(joint, 0));
both functions ast_rtp_codecs_set_preferred_format
and ast_format_cap_get_format increases the ao2 reference count.
Fixes: #856
(cherry picked from commit 95fadcf6db
)
This commit is contained in:
committed by
Asterisk Development Team
parent
1073fd505d
commit
1ec83a5ca4
@@ -1011,6 +1011,7 @@ void ast_rtp_codecs_payloads_destroy(struct ast_rtp_codecs *codecs)
|
||||
AST_VECTOR_FREE(&codecs->payload_mapping_tx);
|
||||
|
||||
ao2_t_cleanup(codecs->preferred_format, "destroying ast_rtp_codec preferred format");
|
||||
codecs->preferred_format = NULL;
|
||||
|
||||
ast_rwlock_destroy(&codecs->codecs_lock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user