router_static: fix a couple of memory leaks

Reported by Coverity as CID #1264352, #1264351
This commit is contained in:
Riccardo Magliocchetti
2015-01-14 15:18:57 +01:00
parent 0ac92e1ad1
commit cd115371b0
+8 -2
View File
@@ -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);