luaRedisGenericCommand() cached argv handling simplified.

As discussed in issue #1945.
This commit is contained in:
antirez 2014-09-10 15:41:05 +02:00
parent 99871803c8
commit 12b56a969f

View File

@ -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) {