mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
luaRedisGenericCommand() cached argv handling simplified.
As discussed in issue #1945.
This commit is contained in:
parent
99871803c8
commit
12b56a969f
@ -222,10 +222,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
|
||||
}
|
||||
|
||||
/* Build the arguments vector */
|
||||
if (!argv) {
|
||||
argv = zmalloc(sizeof(robj*)*argc);
|
||||
argv_size = argc;
|
||||
} else if (argv_size < argc) {
|
||||
if (argv_size < argc) {
|
||||
argv = zrealloc(argv,sizeof(robj*)*argc);
|
||||
argv_size = argc;
|
||||
}
|
||||
@ -403,6 +400,7 @@ cleanup:
|
||||
if (c->argv != argv) {
|
||||
zfree(c->argv);
|
||||
argv = NULL;
|
||||
argv_size = 0;
|
||||
}
|
||||
|
||||
if (raise_error) {
|
||||
|
Loading…
Reference in New Issue
Block a user