mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-28 09:27:03 +00:00
plugins/xslt: fix xmlfile lifecycle
Fixes an use after free and a memory leak. Reported by Coverity as CID #1125165, #1125167
This commit is contained in:
+2
-2
@@ -183,10 +183,9 @@ static int uwsgi_request_xslt(struct wsgi_request *wsgi_req) {
|
||||
return UWSGI_OK;
|
||||
}
|
||||
|
||||
free(xmlfile);
|
||||
|
||||
if (!uwsgi_is_file(filename)) {
|
||||
uwsgi_403(wsgi_req);
|
||||
free(xmlfile);
|
||||
return UWSGI_OK;
|
||||
}
|
||||
filename_len = strlen(filename);
|
||||
@@ -276,6 +275,7 @@ apply:
|
||||
}
|
||||
// we have both the file and the stylesheet, let's run the engine
|
||||
xmlDoc *doc = xmlParseFile(xmlfile);
|
||||
free(xmlfile);
|
||||
if (!doc) {
|
||||
uwsgi_500(wsgi_req);
|
||||
return UWSGI_OK;
|
||||
|
||||
Reference in New Issue
Block a user