]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove unused function
authorAlan T. DeKok <aland@freeradius.org>
Sun, 10 Sep 2023 12:43:21 +0000 (08:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 10 Sep 2023 12:43:21 +0000 (08:43 -0400)
src/lib/util/pair.c
src/lib/util/pair.h

index 19fe00e0edd4150379dd728159c3019d9da204a3..7cb63444bc2a60fc3076b930e9f53326903374ce 100644 (file)
@@ -293,73 +293,6 @@ fr_pair_t *fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
        return vp;
 }
 
-/** Allocate a pooled object that can hold a fr_pair_t any unknown attributes and value buffer
- *
- * @param[in] ctx              to allocate the pooled object in.
- * @param[in] da               If unknown, will be duplicated.
- * @param[in] value_len                The expected length of the buffer.  +1 will be added if this
- *                             if a FR_TYPE_STRING attribute.
- */
-fr_pair_t *fr_pair_afrom_da_with_pool(TALLOC_CTX *ctx, fr_dict_attr_t const *da, size_t value_len)
-{
-       fr_pair_t *vp;
-
-       unsigned int headers = 1;
-
-       /*
-        *      Dict attributes allocate extensions
-        *      contiguously, so we only need one
-        *      header even though there's a variable
-        *      length name buff.
-        */
-       if (da->flags.is_unknown) {
-               headers++;
-               value_len += talloc_array_length(da);   /* accounts for all extensions */
-       }
-
-       switch (da->type) {
-       case FR_TYPE_OCTETS:
-               headers++;
-               break;
-
-       case FR_TYPE_STRING:
-               headers++;
-               value_len++;
-               break;
-
-       default:
-               fr_strerror_printf("Pooled fr_pair_t can only be allocated for "
-                                  "'string' and 'octets' types not '%s'",
-                                  fr_type_to_str(da->type));
-               return NULL;
-
-       }
-
-       vp = talloc_zero_pooled_object(ctx, fr_pair_t, headers, value_len);
-       if (unlikely(!vp)) {
-               fr_strerror_printf("Out of memory");
-               return NULL;
-       }
-       talloc_set_destructor(vp, _fr_pair_free);
-
-       pair_init_null(vp);
-
-       /*
-        *      If we get passed an unknown da, we need to ensure that
-        *      it's parented by "vp".
-        */
-       if (da->flags.is_unknown) {
-               fr_dict_attr_t const *unknown;
-
-               unknown = fr_dict_unknown_copy(vp, da);
-               da = unknown;
-       }
-
-       pair_init_from_da(vp, da);
-
-       return vp;
-}
-
 /** Re-initialise an attribute with a different da
  *
  * If the new da has a different type to the old da, we'll attempt to cast
index 52efb9e15b1c3e10009c024d1d0794389725f658..73c03aeb11c87e5fbe60166fab2faca2c9bed69c 100644 (file)
@@ -432,9 +432,6 @@ fr_pair_t   *fr_pair_root_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da) CC_H
 /** @hidecallergraph */
 fr_pair_t      *fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da) CC_HINT(warn_unused_result) CC_HINT(nonnull(2));
 
-fr_pair_t      *fr_pair_afrom_da_with_pool(TALLOC_CTX *ctx, fr_dict_attr_t const *da, size_t value_len)
-               CC_HINT(warn_unused_result) CC_HINT(nonnull(2));
-
 int            fr_pair_reinit_from_da(fr_pair_list_t *list, fr_pair_t *vp, fr_dict_attr_t const *da)
                CC_HINT(nonnull(2, 3));