diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 92667bf3d1..9fd61db596 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -341,14 +341,18 @@ static abyss_bool http_directory_auth(TSession *r, char *domain_name) if (!domain_name) { if (globals.virtual_host) { - domain_name = (char *) r->requestInfo.host; - if (!strncasecmp(domain_name, "www.", 3)) { - domain_name += 4; + if ((domain_name = (char *) r->requestInfo.host)) { + if (!strncasecmp(domain_name, "www.", 3)) { + domain_name += 4; + } + } + } + if (!domain_name) { + if (globals.default_domain) { + domain_name = globals.default_domain; + } else { + domain_name = switch_core_get_variable("domain"); } - } else if (globals.default_domain) { - domain_name = globals.default_domain; - } else { - domain_name = switch_core_get_variable("domain"); } }