]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Ensure the thread state is the same as the one we set, after calling python land
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Sep 2019 20:19:22 +0000 (15:19 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Sep 2019 20:19:22 +0000 (15:19 -0500)
src/modules/rlm_python/rlm_python.c

index b2fc4ad64dc38daf56dbe3f37733c7dd3271e45f..6ff220d6617b27ad110bf4a2f81166bd43400634 100644 (file)
@@ -664,7 +664,7 @@ static rlm_rcode_t do_python(rlm_python_t const *inst, rlm_python_thread_t *this
 
        PyEval_RestoreThread(this_thread->state);       /* Swap in our local thread state */
        rcode = do_python_single(inst, request, p_func, funcname);
-       PyEval_SaveThread();
+       (void)fr_cond_assert(PyEval_SaveThread() == this_thread->state);
 
        return rcode;
 }