From: Alan T. DeKok Date: Thu, 5 Aug 2021 15:22:12 +0000 (-0400) Subject: allocate from the request, which is thread-safe. Helps with #3188 X-Git-Tag: release_3_0_24~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7875ca06d1e312f55107c5e369097c7cb5369b53;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 --- diff --git a/src/main/pair.c b/src/main/pair.c index 2f736d74cf..3725ba1e10 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) {