From b2b966eda84579e4e17b8d88641c64e9e1975dc5 Mon Sep 17 00:00:00 2001
From: Joshua Colp <jcolp@digium.com>
Date: Mon, 20 Nov 2006 16:04:14 +0000
Subject: [PATCH] Merged revisions 47852 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47852 | file | 2006-11-20 10:58:50 -0500 (Mon, 20 Nov 2006) | 2 lines

Only remove/destroy the RTCP I/O item if it exists.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/rtp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/main/rtp.c b/main/rtp.c
index dfc4df5f4b..005627a5d3 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2941,7 +2941,8 @@ static int p2p_callback_disable(struct ast_channel *chan, struct ast_rtp *rtp, i
 	ast_channel_lock(chan);
 	/* Remove the callback from the IO context */
 	ast_io_remove(rtp->io, iod[0]);
-	ast_io_remove(rtp->io, iod[1]);
+	if (iod[1])
+		ast_io_remove(rtp->io, iod[1]);
 	/* Restore file descriptors */
 	chan->fds[0] = fds[0];
 	chan->fds[1] = fds[1];
@@ -2958,7 +2959,7 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
 	struct ast_frame *fr = NULL;
 	struct ast_channel *who = NULL, *other = NULL, *cs[3] = {NULL, };
 	int p0_fds[2] = {-1, -1}, p1_fds[2] = {-1, -1};
-	int *p0_iod[2] = {NULL, }, *p1_iod[2] = {NULL, };
+	int *p0_iod[2] = {NULL, NULL}, *p1_iod[2] = {NULL, NULL};
 	int p0_callback = 0, p1_callback = 0;
 	enum ast_bridge_result res = AST_BRIDGE_FAILED;
 
-- 
GitLab