Fix reading freed memory in rb_getaddrinfo

This commit is contained in:
Misaki Shioi 2026-03-18 12:37:14 +09:00 committed by Hiroshi SHIBATA
parent 8f8dd01a93
commit 8601f5a42e
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -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.