]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
let's free encode_ctx, too
authorAlan T. DeKok <aland@freeradius.org>
Tue, 10 Aug 2021 18:27:44 +0000 (14:27 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 10 Aug 2021 18:27:44 +0000 (14:27 -0400)
src/lib/unlang/xlat_builtin.c

index 74582be387546c4f22c8db99c8395ce3c3919d4f..18eb2afbce1c756d562548b99aedf81e12d86a87 100644 (file)
@@ -3152,7 +3152,7 @@ static xlat_action_t protocol_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
        memcpy(&tp_encode, xlat_inst, sizeof(tp_encode)); /* const issues */
 
-       if (tmpl_afrom_attr_str(NULL, NULL, &vpt, in_head->vb_strvalue,
+       if (tmpl_afrom_attr_str(ctx, NULL, &vpt, in_head->vb_strvalue,
                                &(tmpl_rules_t){
                                        .dict_def = request->dict,
                                        .prefix = TMPL_ATTR_REF_PREFIX_AUTO
@@ -3165,7 +3165,7 @@ static xlat_action_t protocol_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
         *      Create the encoding context.
         */
        if (tp_encode->test_ctx) {
-               if (tp_encode->test_ctx(&encode_ctx, ctx) < 0) {
+               if (tp_encode->test_ctx(&encode_ctx, vpt) < 0) {
                        talloc_free(vpt);
                        return XLAT_ACTION_FAIL;
                }