From 74d6bac54bfa5d85af9c6052a5399cb92e345ec5 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sun, 27 Jan 2013 10:33:17 +0100 Subject: [PATCH] plugins/python: check return value of PyType_Ready in init_uwsgi_embedded_module Reported by Coverity as CID #970972. --- plugins/python/python_plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index b183bdef..80d29571 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -592,7 +592,11 @@ void init_uwsgi_embedded_module() { PyObject *new_uwsgi_module, *zero; int i; - PyType_Ready(&uwsgi_InputType); + if (PyType_Ready(&uwsgi_InputType) < 0) { + PyErr_Print(); + uwsgi_log("could not initialize the uwsgi python module\n"); + exit(1); + } /* initialize for stats */ up.workers_tuple = PyTuple_New(uwsgi.numproc);