From: Arran Cudbard-Bell Date: Sat, 15 Apr 2023 00:36:14 +0000 (+1000) Subject: redis: Free existing reply before attempting to call the function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246547dd619d37232170642d35b842c60ee5c68c;p=thirdparty%2Ffreeradius-server.git redis: Free existing reply before attempting to call the function --- diff --git a/src/modules/rlm_redis/rlm_redis.c b/src/modules/rlm_redis/rlm_redis.c index 33365e40bc5..48fa5583347 100644 --- a/src/modules/rlm_redis/rlm_redis.c +++ b/src/modules/rlm_redis/rlm_redis.c @@ -425,7 +425,6 @@ 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) { reply = redisCommandArgv(conn->handle, argc, argv, arg_len); status = fr_redis_command_status(conn, reply); @@ -466,7 +465,6 @@ 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) { reply = redisCommandArgv(conn->handle, NUM_ELEMENTS(script_load_argv), script_load_argv, script_load_arg_len); @@ -492,6 +490,7 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, REDEBUG("Function digest %s, does not match calculated digest %s", reply->str, func->digest); goto script_load_failed; } + fr_redis_reply_free(&reply); goto again; } }