]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak error handling. Found by Klockwork (www.klocwork.com)
authorMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 22:34:30 +0000 (22:34 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 22:34:30 +0000 (22:34 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8483 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index 817407178bce398de4d3cc12cc802eaae8577a39..e46d10a62b9b4fb1e672b4eff81de543e29d899a 100644 (file)
@@ -1436,7 +1436,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
                timelimit = atoi(var);
        }
 
-       if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
+       if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS || !peer_session) {
                goto end;
        }
 
@@ -1475,13 +1475,10 @@ SWITCH_STANDARD_APP(att_xfer_function)
                
                switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, bond);
        }
-
- end:
        
-       if (peer_session) {
-               switch_core_session_rwunlock(peer_session);
-       }
+       switch_core_session_rwunlock(peer_session);
        
+ end:
        switch_channel_set_variable(channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
 }