Skip to content

Commit e60093f

Browse files
tugruldenji
authored andcommitted
purge report calloc fix
Report template has not cache file path but it's length is use in buffer memory allocation
1 parent 75a854c commit e60093f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ngx_cache_purge_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) {
15311531
r->headers_out.content_type.len = resp_ct_size - 1;
15321532
r->headers_out.content_type.data = (u_char *) resp_ct;
15331533

1534-
resp_tmpl_len = body_len + key[0].len + r->cache->file.name.len ;
1534+
resp_tmpl_len = body_len + key[0].len ;
15351535

15361536
buf = ngx_pcalloc(r->pool, resp_tmpl_len);
15371537
if (buf == NULL) {
@@ -1543,7 +1543,7 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) {
15431543
return NGX_HTTP_INTERNAL_SERVER_ERROR;
15441544
}
15451545

1546-
len = body_len + key[0].len + r->cache->file.name.len;
1546+
len = body_len + key[0].len;
15471547

15481548
r->headers_out.status = NGX_HTTP_OK;
15491549
r->headers_out.content_length_n = len;

0 commit comments

Comments
 (0)