From 015c9a4f695ab6a79b152e5654581141a6cb380d Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 15 Jan 2025 10:49:52 -0500 Subject: [PATCH] move modification code to locked region. CID #1638648 --- src/lib/unlang/module.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index 11c4fa9fa3..56e0b2d978 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -482,8 +482,6 @@ static void unlang_module_signal(request_t *request, unlang_stack_frame_t *frame request->module = m->mmc.mi->name; safe_lock(m->mmc.mi); if (!(action & state->sigmask)) state->signal(MODULE_CTX(m->mmc.mi, state->thread->data, state->env_data, state->rctx), request, action); - safe_unlock(m->mmc.mi); - request->module = caller; /* * One fewer caller for this module. Since this module @@ -494,6 +492,9 @@ static void unlang_module_signal(request_t *request, unlang_stack_frame_t *frame state->thread->active_callers--; state->signal = NULL; } + + safe_unlock(m->mmc.mi); + request->module = caller; } /** Cleanup after a module completes -- 2.47.3