]> 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:32 +0000 (10:30 -0500)
commit7a7b21f3a0ff4970b8ef85319530ca84a7944b75
tree2fef2e343350682b3bd83969836916aeb971049b
parentdec6ebd9e142a808bb67fde29436c83234271201
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