From: Arran Cudbard-Bell Date: Wed, 11 Sep 2019 20:53:49 +0000 (-0500) Subject: Aways Py_DecRef(inst->module) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28eb5e8d9eb7516d3e2f487cf9ff86e95b156fb1;p=thirdparty%2Ffreeradius-server.git Aways Py_DecRef(inst->module) --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index b5861a23078..ac236e62faf 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -1028,17 +1028,17 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf) static void python_interpreter_free(rlm_python_t *inst, PyThreadState *interp) { - /* - * Only destroy if it's a subinterpreter - */ - if (inst->single_interpreter_mode) return; - /* * We incremented the reference count earlier * during module initialisation. */ Py_DecRef(inst->module); + /* + * Only destroy if it's a subinterpreter + */ + if (inst->single_interpreter_mode) return; + PyEval_AcquireLock(); PyThreadState_Swap(interp); Py_EndInterpreter(interp);