]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Aways Py_DecRef(inst->module)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Sep 2019 20:53:49 +0000 (15:53 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Sep 2019 20:53:54 +0000 (15:53 -0500)
src/modules/rlm_python/rlm_python.c

index b5861a23078ff001dd5f030b50bd8499336b35d1..ac236e62fafaa18e77270539f2230a182ca86af2 100644 (file)
@@ -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);