]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
clean error handling on user endpoint
authorMichael Jerris <mike@jerris.com>
Sun, 27 Jan 2008 22:05:01 +0000 (22:05 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 27 Jan 2008 22:05:01 +0000 (22:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7397 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index 2fecb32e127b137eff7738abd3359e132b3ac989..db53fae7dfb7e35ea155eb6a5c1bead99669905d 100644 (file)
@@ -1433,7 +1433,6 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
        switch_event_create(&params, SWITCH_EVENT_MESSAGE);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true");
-       
 
        if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, params) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n", user, domain);
@@ -1464,10 +1463,6 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                }
        }
 
- done:
-
-       switch_event_destroy(&params);
-
        if (dest) {
                const char *var;
                char *d_dest = NULL;
@@ -1530,10 +1525,14 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                }
        }
 
+ done:
+
        if (xml) {
                switch_xml_free(xml);
        }
        
+       switch_event_destroy(&params);
+
        switch_safe_free(user);
 
        return cause;