summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 230d147be..263dbff18 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3247,7 +3247,9 @@ static int ast_rtp_destroy(struct ast_rtp_instance *instance)
* entry at this point since it holds a reference to the
* RTP instance while it's active.
*/
- close(rtp->rtcp->s);
+ if (rtp->rtcp->s > -1 && rtp->s != rtp->rtcp->s) {
+ close(rtp->rtcp->s);
+ }
ast_free(rtp->rtcp->local_addr_str);
ast_free(rtp->rtcp);
}