Remove unused var desc in luaRegisterFunctionReadPositionalArgs (#130)

desc is set to NULL, never set to anything, and then
checked if it should be freed on the error path if it's NULL.
This can be cleaned up, since it's really unused.

Fixes #129

Signed-off-by: 0del <bany.y0599@gmail.com>
This commit is contained in:
0del 2024-04-02 14:37:19 +07:00 committed by GitHub
parent 0ba2f1b14e
commit 4d7fff9aba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -354,7 +354,6 @@ error:
static int luaRegisterFunctionReadPositionalArgs(lua_State *lua, registerFunctionArgs *register_f_args) { static int luaRegisterFunctionReadPositionalArgs(lua_State *lua, registerFunctionArgs *register_f_args) {
char *err = NULL; char *err = NULL;
sds name = NULL; sds name = NULL;
sds desc = NULL;
luaFunctionCtx *lua_f_ctx = NULL; luaFunctionCtx *lua_f_ctx = NULL;
if (!(name = luaGetStringSds(lua, 1))) { if (!(name = luaGetStringSds(lua, 1))) {
err = "first argument to redis.register_function must be a string"; err = "first argument to redis.register_function must be a string";
@ -377,7 +376,6 @@ static int luaRegisterFunctionReadPositionalArgs(lua_State *lua, registerFunctio
error: error:
if (name) sdsfree(name); if (name) sdsfree(name);
if (desc) sdsfree(desc);
luaPushError(lua, err); luaPushError(lua, err);
return C_ERR; return C_ERR;
} }