mirror of
https://github.com/nginx/nginx.git
synced 2024-12-04 22:09:01 +08:00
Fixed potential segfault in ngx_http_keepalive_handler().
In case of error in the read event handling we close a connection by calling ngx_http_close_connection(), that also destroys connection pool. Thereafter, an attempt to free a buffer (added in r4892) that was allocated from the pool could cause SIGSEGV and is meaningless as well (the buffer already freed with the pool).
This commit is contained in:
parent
890ee444ca
commit
f1d5d03eee
@ -2758,6 +2758,7 @@ ngx_http_keepalive_handler(ngx_event_t *rev)
|
|||||||
if (n == NGX_AGAIN) {
|
if (n == NGX_AGAIN) {
|
||||||
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
|
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user