summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-12-20 07:47:22 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-20 07:47:22 -0600
commit2072057657d5dba665b2854f63372efbf695ccb4 (patch)
tree5839710af6455e33add312babf295bbc265a3089
parentf1d50c0fb0e5dbdb77c89a559bee3324d22b49a6 (diff)
parentc38b750810c27bd026c4ef3760047258eb0b2834 (diff)
Merge "res_rtp_asterisk: Avoid close the rtp/rtcp fd twice." into 13
-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);
}