From: Moises Silva Date: Thu, 26 May 2011 18:10:55 +0000 (-0400) Subject: mod_sangoma_codec: set RTP pointer to NULL on error X-Git-Tag: v1.2-rc1~108^2~11^2~42^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d51cb976cb9b665f779c5420051cd6c84f1e6517;p=thirdparty%2Ffreeswitch.git mod_sangoma_codec: set RTP pointer to NULL on error --- diff --git a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c index c2d6ae40b5..52782ad983 100644 --- a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c +++ b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c @@ -272,6 +272,7 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r } rtp_port = (switch_port_t)(long)*rtp_fd; + *rtp_fd = NULL; codec_req_leg->host_udp_port = rtp_port; @@ -307,6 +308,9 @@ static int sangoma_destroy_rtp(void *usr_priv, void *fd) { switch_memory_pool_t *sesspool; switch_rtp_t *rtp = fd; + if (!rtp) { + return 0; + } sesspool = switch_rtp_get_private(rtp); switch_rtp_destroy(&rtp); switch_core_destroy_memory_pool(&sesspool);