mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix refleaks of ast_rtp_instance structures.
These refleaks were causing bridged calls not to close their RTP ports. Thus a call would leave open 4 ports (RTP for party A, RTCP for party A, RTP for party B, and RTCP for party B). This led to an eventual depletion of available RTP ports. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@399924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -118,8 +118,12 @@ static int native_rtp_bridge_start(struct ast_bridge *bridge, struct ast_channel
|
||||
struct ast_bridge_channel *c1 = AST_LIST_LAST(&bridge->channels);
|
||||
enum ast_rtp_glue_result native_type;
|
||||
struct ast_rtp_glue *glue0, *glue1;
|
||||
struct ast_rtp_instance *instance0 = NULL, *instance1 = NULL, *vinstance0 = NULL;
|
||||
struct ast_rtp_instance *vinstance1 = NULL, *tinstance0 = NULL, *tinstance1 = NULL;
|
||||
RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, instance1, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, vinstance0, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, vinstance1, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, tinstance0, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, tinstance1, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_format_cap *, cap0, ast_format_cap_alloc_nolock(), ast_format_cap_destroy);
|
||||
RAII_VAR(struct ast_format_cap *, cap1, ast_format_cap_alloc_nolock(), ast_format_cap_destroy);
|
||||
|
||||
@@ -185,7 +189,10 @@ static void native_rtp_bridge_stop(struct ast_bridge *bridge, struct ast_channel
|
||||
struct ast_bridge_channel *c1 = AST_LIST_LAST(&bridge->channels);
|
||||
enum ast_rtp_glue_result native_type;
|
||||
struct ast_rtp_glue *glue0, *glue1 = NULL;
|
||||
struct ast_rtp_instance *instance0 = NULL, *instance1 = NULL, *vinstance0 = NULL, *vinstance1 = NULL;
|
||||
RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, instance1, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, vinstance0, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_rtp_instance *, vinstance1, NULL, ao2_cleanup);
|
||||
|
||||
if (c0 == c1) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user