clean error handling on user endpoint

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7397 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-01-27 22:05:01 +00:00
parent 84161010ab
commit ff8be6244c
1 changed files with 4 additions and 5 deletions

View 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;