]> 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:25:49 +0000 (11:25 -0400)
commitbdc8159799fc07612806236344be232afcc7c653
treebfe36e7adcd3f3cdd07058ffb055b15d608bbc4f
parente3e24a0844ee4792deffcf470752e1be0de873d8
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