diff --git a/src/configure/auto_mozilla.rs b/src/configure/auto_mozilla.rs index 0da737fcd..81843f0d0 100644 --- a/src/configure/auto_mozilla.rs +++ b/src/configure/auto_mozilla.rs @@ -39,9 +39,7 @@ pub unsafe fn moz_autoconfigure( tag_config: 0, }; - let url_c = url.strdup(); - let xml_raw = read_autoconf_file(context, url_c); - free(url_c as *mut libc::c_void); + let xml_raw = read_autoconf_file(context, url); if xml_raw.is_null() { return None; } diff --git a/src/configure/auto_outlook.rs b/src/configure/auto_outlook.rs index 52f7e0d4b..b69c1cb50 100644 --- a/src/configure/auto_outlook.rs +++ b/src/configure/auto_outlook.rs @@ -50,7 +50,7 @@ pub unsafe fn outlk_autodiscover( 0, ::std::mem::size_of::(), ); - xml_raw = read_autoconf_file(context, url); + xml_raw = read_autoconf_file(context, as_str(url)); if xml_raw.is_null() { ok_to_continue = false; break; diff --git a/src/configure/mod.rs b/src/configure/mod.rs index 6746e7e2d..f4e5d5fbb 100644 --- a/src/configure/mod.rs +++ b/src/configure/mod.rs @@ -663,11 +663,11 @@ pub fn dc_stop_ongoing_process(context: &Context) { }; } -pub fn read_autoconf_file(context: &Context, url: *const libc::c_char) -> *mut libc::c_char { - info!(context, 0, "Testing {} ...", to_string(url)); +pub fn read_autoconf_file(context: &Context, url: &str) -> *mut libc::c_char { + info!(context, 0, "Testing {} ...", url); match reqwest::Client::new() - .get(as_str(url)) + .get(url) .send() .and_then(|mut res| res.text()) {