diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 3713e6f7a..5f76749db 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -681,6 +681,7 @@ try_next_result: if (wsi->dns_results_next) goto next_result; } + lws_addrinfo_clean(wsi); cce = "Unable to connect"; //failed: @@ -870,7 +871,10 @@ solo: wsi->detlat.earliest_write_req_pre_write = lws_now_usecs(); #endif #if !defined(LWS_WITH_SYS_ASYNC_DNS) - n = lws_getaddrinfo46(wsi, ads, &result); + if (wsi->dns_results) + n = 0; + else + n = lws_getaddrinfo46(wsi, ads, &result); #else lwsi_set_state(wsi, LRS_WAITING_DNS); /* this is either FAILED, CONTINUING, or already called connect_4 */