mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-04 20:51:29 +00:00
router_static: fix a couple of memory leaks
Reported by Coverity as CID #1264352, #1264351
This commit is contained in:
@@ -141,7 +141,10 @@ int uwsgi_routing_func_sendfile(struct wsgi_request *wsgi_req, struct uwsgi_rout
|
||||
// static file - don't update avg_rt after request
|
||||
wsgi_req->do_not_account_avg_rt = 1;
|
||||
|
||||
if (urfc->no_headers) goto send;
|
||||
if (urfc->no_headers) {
|
||||
uwsgi_buffer_destroy(ub_s);
|
||||
goto send;
|
||||
}
|
||||
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, ub_s->buf, ub_s->pos)) {
|
||||
uwsgi_buffer_destroy(ub_s);
|
||||
@@ -211,7 +214,10 @@ int uwsgi_routing_func_fastfile(struct wsgi_request *wsgi_req, struct uwsgi_rout
|
||||
// static file - don't update avg_rt after request
|
||||
wsgi_req->do_not_account_avg_rt = 1;
|
||||
|
||||
if (urfc->no_headers) goto send;
|
||||
if (urfc->no_headers) {
|
||||
uwsgi_buffer_destroy(ub_s);
|
||||
goto send;
|
||||
}
|
||||
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, ub_s->buf, ub_s->pos)) {
|
||||
uwsgi_buffer_destroy(ub_s);
|
||||
|
||||
Reference in New Issue
Block a user