comparison src/http/ngx_http_file_cache.c @ 2603:f9bd7999eb08

fix segfault if ngx_read_file() will fail
author Igor Sysoev <igor@sysoev.ru>
date Tue, 24 Mar 2009 15:03:38 +0000
parents df5e99f6464b
children 2a35ed59827d
comparison
equal deleted inserted replaced
2602:4ed2fa197a4a 2603:f9bd7999eb08
249 249
250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
251 "http file cache fd: %d", of.fd); 251 "http file cache fd: %d", of.fd);
252 252
253 c->file.fd = of.fd; 253 c->file.fd = of.fd;
254 c->file.log = r->connection->log;
254 255
255 c->buf = ngx_create_temp_buf(r->pool, c->body_start); 256 c->buf = ngx_create_temp_buf(r->pool, c->body_start);
256 if (c->buf == NULL) { 257 if (c->buf == NULL) {
257 return NGX_ERROR; 258 return NGX_ERROR;
258 } 259 }