mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Use ngx_calloc_buf() where appropriate.
This commit is contained in:
parent
f947167442
commit
cac361718c
@ -203,7 +203,7 @@ ngx_http_flv_handler(ngx_http_request_t *r)
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
@ -217,7 +217,7 @@ ngx_http_flv_handler(ngx_http_request_t *r)
|
||||
}
|
||||
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ ngx_http_gzip_filter_gzheader(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
|
||||
static u_char gzheader[10] =
|
||||
{ 0x1f, 0x8b, Z_DEFLATED, 0, 0, 0, 0, 0, 0, 3 };
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
|
||||
|
||||
/* we need to allocate all before the header would be sent */
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
|
||||
size_t len;
|
||||
ngx_buf_t *b;
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -633,7 +633,7 @@ ngx_http_image_asis(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
|
||||
{
|
||||
ngx_buf_t *b;
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ transparent:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
gdFree(out);
|
||||
return NULL;
|
||||
|
@ -636,7 +636,7 @@ ngx_http_mp4_handler(ngx_http_request_t *r)
|
||||
}
|
||||
|
||||
if (mp4 == NULL) {
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ ngx_http_static_handler(ngx_http_request_t *r)
|
||||
|
||||
/* we need to allocate all before the header would be sent */
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
ngx_free(buf);
|
||||
return NULL;
|
||||
|
@ -1926,7 +1926,7 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
|
||||
return ngx_http_send_header(r);
|
||||
}
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
@ -1577,7 +1577,7 @@ ngx_http_cache_send(ngx_http_request_t *r)
|
||||
|
||||
/* we need to allocate all before the header would be sent */
|
||||
|
||||
b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
|
||||
b = ngx_calloc_buf(r->pool);
|
||||
if (b == NULL) {
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user