]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't lock if there's no interpreter.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 19:01:30 +0000 (15:01 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 19:16:41 +0000 (15:16 -0400)
Mainly to shut up coverity.  CID #1400046

src/modules/rlm_lua/lua.c

index 9bc4f8544fc0c186ae1854e53a23de55671e39d1..904dccdf7f55336b5a63085d189e28f674ea8d28 100644 (file)
@@ -818,6 +818,8 @@ static lua_State *rlm_lua_get_interp(rlm_lua_t const *inst) {
         *      and return the instance specific interpreter.
         */
        if (!inst->threads) {
+               if (!inst->interpreter) return NULL;
+
                pthread_mutex_lock(inst->mutex);
                return inst->interpreter;
        }