tmpl_free function is no longer needed, as value_pair_tmpl_t have an internal buffer...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Mar 2015 19:00:47 +0000 (14:00 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 5 Mar 2015 00:11:31 +0000 (19:11 -0500)
src/include/tmpl.h
src/main/modcall.c
src/main/tmpl.c

index a68005e..1c30072 100644 (file)
@@ -238,8 +238,6 @@ ssize_t                     tmpl_afrom_attr_str(TALLOC_CTX *ctx, value_pair_tmpl_t **out, char con
 ssize_t                        tmpl_afrom_str(TALLOC_CTX *ctx, value_pair_tmpl_t **out, char const *name, size_t inlen,
                                       FR_TOKEN type, request_refs_t request_def, pair_lists_t list_def, bool do_escape);
 
-void                   tmpl_free(value_pair_tmpl_t **tmpl);
-
 bool                   tmpl_cast_in_place(value_pair_tmpl_t *vpt, PW_TYPE type, DICT_ATTR const *enumv);
 
 void                   tmpl_cast_in_place_str(value_pair_tmpl_t *vpt);
index 141d62a..0c8cada 100644 (file)
@@ -1529,7 +1529,7 @@ int modcall_fixup_update(value_pair_map_t *map, UNUSED void *ctx)
                             cf_pair_filename(cp), cf_pair_lineno(cp));
                }
 
-               tmpl_free(&map->rhs);
+               TALLOC_FREE(map->rhs);
 
                map->rhs = tmpl_alloc(map, TMPL_TYPE_NULL, NULL, 0);
        }
index 5362b54..c18a722 100644 (file)
@@ -1048,23 +1048,6 @@ ssize_t tmpl_afrom_attr_str(TALLOC_CTX *ctx, value_pair_tmpl_t **out, char const
        return slen;
 }
 
-/** Release memory allocated to value pair template.
- *
- * @param[in,out] tmpl to free.
- */
-void tmpl_free(value_pair_tmpl_t **tmpl)
-{
-       if (*tmpl == NULL) return;
-
-       if ((*tmpl)->type != TMPL_TYPE_UNKNOWN) VERIFY_TMPL(*tmpl);
-
-       dict_attr_free(&((*tmpl)->tmpl_da));
-
-       talloc_free(*tmpl);
-
-       *tmpl = NULL;
-}
-
 /**  Print a template to a string
  *
  * @param[out] buffer for the output string