From 28153af4ada67053e23d3b7a6e04aaf55590f65f Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sat, 9 Mar 2013 16:21:16 +0100 Subject: [PATCH] plugin/python: fix leak in uwsgi_file_loader Reported by Coverity as CID #971055. --- plugins/python/pyloader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c index c341f66e..60ea280a 100644 --- a/plugins/python/pyloader.c +++ b/plugins/python/pyloader.c @@ -563,7 +563,9 @@ PyObject *uwsgi_file_loader(void *arg1) { char *callable = up.callable; if (!callable) callable = "application"; - char *py_filename = uwsgi_concat2("uwsgi_file_", uwsgi_pythonize(filename)); + char *pythonized_filename = uwsgi_pythonize(filename); + char *py_filename = uwsgi_concat2("uwsgi_file_", pythonized_filename); + free(pythonized_filename); wsgi_file_module = uwsgi_pyimport_by_filename(py_filename, filename); if (!wsgi_file_module) {