]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove radius_pair_create
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 16 May 2018 08:40:44 +0000 (14:40 +0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 16 May 2018 08:40:44 +0000 (14:40 +0600)
src/include/radiusd.h
src/main/pair.c
src/modules/rlm_expr/paircmp.c

index d2b195ea9591d555889c5ea0592f7b9cf26eb403..5ecc8a0174187e3547d641c4c489ee6168a593f7 100644 (file)
@@ -495,7 +495,6 @@ int radius_callback_compare(REQUEST *request, VALUE_PAIR *req,
                            VALUE_PAIR *check, VALUE_PAIR *check_pairs,
                            VALUE_PAIR **reply_pairs);
 int radius_find_compare(fr_dict_attr_t const *attribute);
-VALUE_PAIR     *radius_pair_create(TALLOC_CTX *ctx, VALUE_PAIR **vps, unsigned int attribute, unsigned int vendor);
 
 /*
  *     Less code == fewer bugs
index 1087d94179cad0333240ab47c1f90c07c90c1bc4..ca87e5f41fc4299eac5cbdb5cd7f7d141917f7bf 100644 (file)
@@ -693,35 +693,6 @@ int xlat_eval_do(REQUEST *request, VALUE_PAIR *vp)
        return 0;
 }
 
-/** Create a #VALUE_PAIR and add it to a list of #VALUE_PAIR s
- *
- * @note This function ALWAYS returns. If we're OOM, then it causes the
- * @note server to exit, so you don't need to check the return value.
- *
- * @param[in] ctx for talloc
- * @param[out] vps List to add new #VALUE_PAIR to, if NULL will just
- *     return #VALUE_PAIR.
- * @param[in] attribute number.
- * @param[in] vendor number.
- * @return a new #VALUE_PAIR or causes server to exit on error.
- */
-VALUE_PAIR *radius_pair_create(TALLOC_CTX *ctx, VALUE_PAIR **vps,
-                             unsigned int attribute, unsigned int vendor)
-{
-       VALUE_PAIR *vp;
-
-       vp = fr_pair_afrom_num(ctx, vendor, attribute);
-       if (!vp) {
-               ERROR("No memory!");
-               rad_assert("No memory" == NULL);
-               fr_exit_now(1);
-       }
-
-       if (vps) fr_pair_add(vps, vp);
-
-       return vp;
-}
-
 /** Print a list of VALUE_PAIRs.
  *
  * @param[in] level Debug level (1-4).
index 0f365c99f2a0047d69442045a7292fbbf9249b98..1a2ada3570f8fb3a165fba26734d8e379ff56168 100644 (file)
@@ -117,8 +117,8 @@ static int presufcmp(UNUSED void *instance,
                 *      If "request" is NULL, then the memory will be
                 *      lost!
                 */
-               vp = radius_pair_create(request->packet, &req, FR_STRIPPED_USER_NAME, 0);
-               if (!vp) return ret;
+               MEM(vp = fr_pair_afrom_num(request->packet, 0, FR_STRIPPED_USER_NAME));
+               fr_pair_add(&req, vp);
                request->username = vp;
        }