Merge of r5083: fixed potential segfault in keepalive handler.

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:
Maxim Dounin 2013-03-29 17:19:11 +00:00
parent b90ec1b1a2
commit 1a3988af90
1 changed files with 1 additions and 0 deletions

View File

@ -2743,6 +2743,7 @@ ngx_http_keepalive_handler(ngx_event_t *rev)
if (n == NGX_AGAIN) {
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
ngx_http_close_connection(c);
return;
}
/*