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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 62a321147..32b762e8d 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -566,6 +566,8 @@ static int ast_rtp_new(struct ast_rtp_instance *instance,
/* See if we ran out of ports or if the bind actually failed because of something other than the address being in use */
if (x == startplace || errno != EADDRINUSE) {
ast_log(LOG_ERROR, "Oh dear... we couldn't allocate a port for RTP instance '%p'\n", instance);
+ close(rtp->s);
+ ast_free(rtp);
return -1;
}
}