]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1024250 Dereference before null check. CID:1024251 Dereference before null check...
authorMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 18:34:25 +0000 (18:34 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 18:34:25 +0000 (18:34 +0000)
src/mod/endpoints/mod_sofia/rtp.c

index bbb78c88a21a71e03b9efa1aedf84c4a8f03cc8a..3f704c5f101fe3152fa731daf4071ff7df447e80 100644 (file)
@@ -529,22 +529,19 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
     }
 
     return SWITCH_STATUS_SUCCESS;
+
 fail:
-     if (tech_pvt) {
-        if (tech_pvt->read_codec.implementation) {
-                       switch_core_codec_destroy(&tech_pvt->read_codec);
-               }
-               
-               if (tech_pvt->write_codec.implementation) {
-                       switch_core_codec_destroy(&tech_pvt->write_codec);
-               }
-    }
-    
-    if (session) {
-        switch_core_session_destroy(&session);
-    }
-    return SWITCH_STATUS_FALSE;
+       if (tech_pvt->read_codec.implementation) {
+               switch_core_codec_destroy(&tech_pvt->read_codec);
+       }
+       
+       if (tech_pvt->write_codec.implementation) {
+               switch_core_codec_destroy(&tech_pvt->write_codec);
+       }
 
+       switch_core_session_destroy(&session);
+
+    return SWITCH_STATUS_FALSE;
 }
 
 static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)