提交 c61be913 authored 作者: Michael Jerris's avatar Michael Jerris

CID:1294463,1294540: clean up duplicate error checking code

上级 c7709a19
...@@ -434,7 +434,6 @@ SWITCH_STANDARD_API(reg_url_function) ...@@ -434,7 +434,6 @@ SWITCH_STANDARD_API(reg_url_function)
char *reply = "error/facility_not_subscribed"; char *reply = "error/facility_not_subscribed";
switch_stream_handle_t mystream = { 0 }; switch_stream_handle_t mystream = { 0 };
if (!cmd) { if (!cmd) {
stream->write_function(stream, "%s", ""); stream->write_function(stream, "%s", "");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -445,7 +444,6 @@ SWITCH_STANDARD_API(reg_url_function) ...@@ -445,7 +444,6 @@ SWITCH_STANDARD_API(reg_url_function)
exclude_contact = switch_channel_get_variable(channel, "sip_exclude_contact"); exclude_contact = switch_channel_get_variable(channel, "sip_exclude_contact");
} }
data = strdup(cmd); data = strdup(cmd);
switch_assert(data); switch_assert(data);
...@@ -467,18 +465,12 @@ SWITCH_STANDARD_API(reg_url_function) ...@@ -467,18 +465,12 @@ SWITCH_STANDARD_API(reg_url_function)
domain = dup_domain; domain = dup_domain;
} }
if (!user) goto end;
SWITCH_STANDARD_STREAM(mystream); SWITCH_STANDARD_STREAM(mystream);
switch_assert(mystream.data); switch_assert(mystream.data);
select_url(user, domain, concat, exclude_contact, &mystream); select_url(user, domain, concat, exclude_contact, &mystream);
reply = mystream.data; reply = mystream.data;
end:
if (zstr(reply)) { if (zstr(reply)) {
reply = "error/user_not_registered"; reply = "error/user_not_registered";
} else if (end_of(reply) == ',') { } else if (end_of(reply) == ',') {
...@@ -489,7 +481,6 @@ SWITCH_STANDARD_API(reg_url_function) ...@@ -489,7 +481,6 @@ SWITCH_STANDARD_API(reg_url_function)
reply = NULL; reply = NULL;
switch_safe_free(mystream.data); switch_safe_free(mystream.data);
switch_safe_free(data); switch_safe_free(data);
switch_safe_free(dup_domain); switch_safe_free(dup_domain);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论