Bug 879999: Move dcb null check above first use (aurora) r=jesup a=lsblakk
authorAdam Roach [:abr] <adam@nostrum.com>
Wed, 05 Jun 2013 17:33:41 -0500
changeset 142865 443b1a5821a2ea13f62a42ae377862fa7a4f0f5e
parent 142864 f7f709c5d7c4fa58064f62c2c14fc35548c642ea
child 142866 555b2dc7ce283fad5588bb4958f7d4368c7b7b6f
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lsblakk
bugs879999
milestone23.0a2
Bug 879999: Move dcb null check above first use (aurora) r=jesup a=lsblakk
media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
--- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
@@ -3313,16 +3313,21 @@ fsmdef_ev_setremotedesc(sm_event_t *even
     boolean             has_audio;
     boolean             has_video;
     boolean             has_data;
     char                *remote_sdp = 0;
     uint32_t            remote_sdp_len = 0;
 
     FSM_DEBUG_SM(DEB_F_PREFIX"Entered.", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
 
+    if (dcb == NULL) {
+        FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
+        return SM_RC_CLEANUP;
+    }
+
     config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
     if (!sdpmode) {
         ui_set_remote_description(evSetRemoteDescError, line, call_id,
             dcb->caller_id.call_instance_id, strlib_empty(),
             PC_INTERNAL_ERROR, "'sdpmode' configuration is false. This should "
             "never ever happen. Run for your lives!");
         return (SM_RC_END);
     }
@@ -3335,22 +3340,16 @@ fsmdef_ev_setremotedesc(sm_event_t *even
                      DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
         ui_set_remote_description(evSetRemoteDescError, line, call_id,
             dcb->caller_id.call_instance_id, strlib_empty(),
             PC_INVALID_STATE, "Renegotiation of session description is not "
             "currently supported. See Bug 840728 for status.");
         return (SM_RC_END);
     }
 
-
-    if (dcb == NULL) {
-        FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
-        return SM_RC_CLEANUP;
-    }
-
     cc_initialize_msg_body_parts_info(&msg_body);
 
     /* !!! NOTE !!! The following code sets up the pointers inside
        msg_body.parts[0] to point directly to the buffers from the
        event->msg structure. While this is more efficient than
        copying them, we must take exceptional care not to call
        cc_free_msg_body_parts() on this particular msg_body, since
        doing so would result in the buffers being freed twice. */