comparison src/http/modules/ngx_http_flv_module.c @ 6973:99934aade555

Use ngx_calloc_buf() where appropriate.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 12 Apr 2017 22:21:04 +0300
parents 192f54280a7a
children 7a55311b0dc3
comparison
equal deleted inserted replaced
6972:6e8c249b34ea 6973:99934aade555
201 if (ngx_http_set_content_type(r) != NGX_OK) { 201 if (ngx_http_set_content_type(r) != NGX_OK) {
202 return NGX_HTTP_INTERNAL_SERVER_ERROR; 202 return NGX_HTTP_INTERNAL_SERVER_ERROR;
203 } 203 }
204 204
205 if (i == 0) { 205 if (i == 0) {
206 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 206 b = ngx_calloc_buf(r->pool);
207 if (b == NULL) { 207 if (b == NULL) {
208 return NGX_HTTP_INTERNAL_SERVER_ERROR; 208 return NGX_HTTP_INTERNAL_SERVER_ERROR;
209 } 209 }
210 210
211 b->pos = ngx_flv_header; 211 b->pos = ngx_flv_header;
215 out[0].buf = b; 215 out[0].buf = b;
216 out[0].next = &out[1]; 216 out[0].next = &out[1];
217 } 217 }
218 218
219 219
220 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 220 b = ngx_calloc_buf(r->pool);
221 if (b == NULL) { 221 if (b == NULL) {
222 return NGX_HTTP_INTERNAL_SERVER_ERROR; 222 return NGX_HTTP_INTERNAL_SERVER_ERROR;
223 } 223 }
224 224
225 b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t)); 225 b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));