comparison src/http/modules/ngx_http_image_filter_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 e4b00a021cea
children
comparison
equal deleted inserted replaced
6972:6e8c249b34ea 6973:99934aade555
579 ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx) 579 ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
580 { 580 {
581 size_t len; 581 size_t len;
582 ngx_buf_t *b; 582 ngx_buf_t *b;
583 583
584 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 584 b = ngx_calloc_buf(r->pool);
585 if (b == NULL) { 585 if (b == NULL) {
586 return NULL; 586 return NULL;
587 } 587 }
588 588
589 b->memory = 1; 589 b->memory = 1;
631 static ngx_buf_t * 631 static ngx_buf_t *
632 ngx_http_image_asis(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx) 632 ngx_http_image_asis(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
633 { 633 {
634 ngx_buf_t *b; 634 ngx_buf_t *b;
635 635
636 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 636 b = ngx_calloc_buf(r->pool);
637 if (b == NULL) { 637 if (b == NULL) {
638 return NULL; 638 return NULL;
639 } 639 }
640 640
641 b->pos = ctx->image; 641 b->pos = ctx->image;
1065 if (cln == NULL) { 1065 if (cln == NULL) {
1066 gdFree(out); 1066 gdFree(out);
1067 return NULL; 1067 return NULL;
1068 } 1068 }
1069 1069
1070 b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); 1070 b = ngx_calloc_buf(r->pool);
1071 if (b == NULL) { 1071 if (b == NULL) {
1072 gdFree(out); 1072 gdFree(out);
1073 return NULL; 1073 return NULL;
1074 } 1074 }
1075 1075