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 */
|
/* Build the arguments vector */
|
||||||
if (!argv) {
|
if (argv_size < argc) {
|
||||||
argv = zmalloc(sizeof(robj*)*argc);
|
|
||||||
argv_size = argc;
|
|
||||||
} else if (argv_size < argc) {
|
|
||||||
argv = zrealloc(argv,sizeof(robj*)*argc);
|
argv = zrealloc(argv,sizeof(robj*)*argc);
|
||||||
argv_size = argc;
|
argv_size = argc;
|
||||||
}
|
}
|
||||||
@ -403,6 +400,7 @@ cleanup:
|
|||||||
if (c->argv != argv) {
|
if (c->argv != argv) {
|
||||||
zfree(c->argv);
|
zfree(c->argv);
|
||||||
argv = NULL;
|
argv = NULL;
|
||||||
|
argv_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (raise_error) {
|
if (raise_error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user