From 7875ca06d1e312f55107c5e369097c7cb5369b53 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 5 Aug 2021 11:22:12 -0400 Subject: [PATCH] allocate from the request, which is thread-safe. Helps with #3188 The "check" item is taken from the "huntgroups" file. It's in a statically allocated list which doesn't change, and shouldn't change during run-time. Allocating memory in its context is not thread-safe, and can cause issues --- src/main/pair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/pair.c b/src/main/pair.c index 2f736d74cf7..3725ba1e10b 100644 --- a/src/main/pair.c +++ b/src/main/pair.c @@ -84,13 +84,13 @@ int radius_compare_vps(UNUSED REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *v if (check->da->type == PW_TYPE_STRING) { expr_p = check->vp_strvalue; } else { - expr_p = expr = vp_aprints_value(check, check, '\0'); + expr_p = expr = vp_aprints_value(request, check, '\0'); } if (vp->da->type == PW_TYPE_STRING) { value_p = vp->vp_strvalue; } else { - value_p = value = vp_aprints_value(vp, vp, '\0'); + value_p = value = vp_aprints_value(request, vp, '\0'); } if (!expr_p || !value_p) { -- 2.47.3