From: Alan T. DeKok Date: Thu, 5 Aug 2021 19:00:01 +0000 (-0400) Subject: allocate from the request, which is thread-safe. Helps with #3188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=653ed7b6e11066263c70bd4572b43ff1c312810f;p=thirdparty%2Ffreeradius-server.git 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 --- 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; }