]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make sure to free tag ctx, too
authorAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 16:12:44 +0000 (11:12 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 16:12:44 +0000 (11:12 -0500)
src/protocols/radius/decode.c

index 5489bb27a6c2ae8ee8737b7adf72bf7908986e55..2bbbcd536426834aaed510b9674772e9ff99690b 100644 (file)
@@ -2115,6 +2115,12 @@ ssize_t fr_radius_decode_foreign(TALLOC_CTX *ctx, fr_pair_list_t *out,
        return data_len;
 }
 
+static int _test_ctx_free(fr_radius_decode_ctx_t *ctx)
+{
+       TALLOC_FREE(ctx->tags);
+
+       return 0;
+}
 
 static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
 {
@@ -2132,6 +2138,7 @@ static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
 
        test_ctx->request_authenticator = vector;
        test_ctx->tmp_ctx = talloc_zero(test_ctx, uint8_t);
+       talloc_set_destructor(test_ctx, _test_ctx_free);
 
        *out = test_ctx;