From 653ed7b6e11066263c70bd4572b43ff1c312810f Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 5 Aug 2021 15:00:01 -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 Manual port of commit 7875ca06d1 --- src/lib/server/paircmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/server/paircmp.c b/src/lib/server/paircmp.c index 2d05ad08ac7..ca521872797 100644 --- a/src/lib/server/paircmp.c +++ b/src/lib/server/paircmp.c @@ -244,14 +244,14 @@ int paircmp_pairs(UNUSED request_t *request, fr_pair_t *check, fr_pair_t *vp) if (check->vp_type == FR_TYPE_STRING) { expr_p = check->vp_strvalue; } else { - fr_value_box_aprint(check, &expr, &check->data, NULL); + fr_value_box_aprint(request, &expr, &check->data, NULL); expr_p = expr; } if (vp->vp_type == FR_TYPE_STRING) { value_p = vp->vp_strvalue; } else { - fr_value_box_aprint(vp, &value, &vp->data, NULL); + fr_value_box_aprint(request, &value, &vp->data, NULL); value_p = value; } -- 2.47.3