diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 6cdf5c6abc..f1fbcc35de 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -601,13 +601,9 @@ start: if (need_free) free_getaddrinfo_arg(arg); if (timedout) { - if (arg->ai) { - rsock_raise_user_specified_timeout(arg->ai, Qnil, Qnil); - } else { - VALUE host = rb_str_new_cstr(hostp); - VALUE port = rb_str_new_cstr(portp); - rsock_raise_user_specified_timeout(NULL, host, port); - } + VALUE host = rb_str_new_cstr(hostp); + VALUE port = rb_str_new_cstr(portp); + rsock_raise_user_specified_timeout(NULL, host, port); } // If the current thread is interrupted by asynchronous exception, the following raises the exception.