Store the length of the static argv when first allocated.

This commit is contained in:
Paddy Byers 2014-08-15 22:02:05 +01:00 committed by antirez
parent 8fb8a474fd
commit 59ad68ca4f

View File

@ -224,6 +224,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) {
argv = zrealloc(argv,sizeof(robj*)*argc);
argv_size = argc;