]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix crash on chan open failure
authorMathieu Rene <mrene@avgs.ca>
Thu, 26 Jul 2012 00:04:35 +0000 (20:04 -0400)
committerMathieu Rene <mrene@avgs.ca>
Thu, 26 Jul 2012 00:04:35 +0000 (20:04 -0400)
libs/freetdm/mod_freetdm/tdm.c

index 5b9f1486eca3ebc37e60d2ca756262cbc4b38341..9ef95a7bfc11e0d8ca6f6c956e06fe5c53d32be5 100644 (file)
@@ -270,9 +270,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
                if (tech_pvt->write_codec.implementation) {
                        switch_core_codec_destroy(&tech_pvt->write_codec);
                }
+        
+        ftdm_channel_close(&tech_pvt->ftdm_channel);
        }
-    
-    ftdm_channel_close(&tech_pvt->ftdm_channel);
 
     return SWITCH_STATUS_SUCCESS;
 }