]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free on both read/write and read only paths
authorNick Porter <nick@portercomputing.co.uk>
Fri, 14 Apr 2023 07:43:32 +0000 (08:43 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 14 Apr 2023 07:43:32 +0000 (08:43 +0100)
src/modules/rlm_redis/rlm_redis.c

index d9bea2dfde4f99be29965fed57b69b0407bf4318..4b773127a36da711a5833f18c010bc4f753fe438 100644 (file)
@@ -425,8 +425,8 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                        for (int i = 2; i < argc; i++) RDEBUG3("[%i] %s", i, argv[i]);
                        REXDENT();
                }
+               fr_redis_reply_free(&reply);
                if (!func->read_only) {
-                       fr_redis_reply_free(&reply);
                        reply = redisCommandArgv(conn->handle, argc, argv, arg_len);
                        status = fr_redis_command_status(conn, reply);
                } else if (redis_command_read_only(&status, &reply, request, conn, argc, argv, arg_len) == -2) {
@@ -466,8 +466,8 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                         *      synchronous code will need to be rewritten, so for now
                         *      we just load the script and try again.
                         */
+                       fr_redis_reply_free(&reply);
                        if (!func->read_only) {
-                               fr_redis_reply_free(&reply);
                                reply = redisCommandArgv(conn->handle, NUM_ELEMENTS(script_load_argv),
                                                         script_load_argv, script_load_arg_len);
                                status = fr_redis_command_status(conn, reply);