]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Fix crash on ast_rtp_new failure.
authorCorey Farrell <git@cfware.com>
Fri, 21 Sep 2018 15:19:52 +0000 (11:19 -0400)
committerCorey Farrell <git@cfware.com>
Fri, 21 Sep 2018 15:30:38 +0000 (10:30 -0500)
commit21f472355e64d2ea1e095f51d65d9b1adf11c6a9
tree462c8e71a317ac1caa68ea68a3f17c1dd350bbc3
parent51656adf35dbe09b72a5550b63999803b49f3638
res_rtp_asterisk: Fix crash on ast_rtp_new failure.

ast_rtp_new free'd rtp upon failure, but rtp_engine.c would also call
the destroy callback.  Remove call to ast_free from ast_rtp_new, leave
it to rtp_engine.c to initiate the full cleanup.  Add error detection
for the ssrc_mapping vector initialization.  In rtp_allocate_transport
set rtp->s = -1 in the failure path where we close that FD to ensure we
don't try closing it twice.

ASTERISK-27854 #close

Change-Id: Ie02aecbb46228ca804e24b19cec2bb6f7b94e451
res/res_rtp_asterisk.c