]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free previous redis result before retrieving another
authorNick Porter <nick@portercomputing.co.uk>
Thu, 13 Apr 2023 16:18:33 +0000 (17:18 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 13 Apr 2023 16:18:33 +0000 (17:18 +0100)
src/modules/rlm_redis/rlm_redis.c

index e741cf776a415d48ff9dd2bfc9d91f700a1d0cbc..3ac92c21506a060e61520c4c566d32f8a5e25eae 100644 (file)
@@ -426,6 +426,7 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                        REXDENT();
                }
                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,6 +467,7 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                         *      we just load the script and try again.
                         */
                        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);