Skip to content

Commit

Permalink
luaRedisGenericCommand() cached argv handling simplified.
Browse files Browse the repository at this point in the history
As discussed in issue redis#1945.
  • Loading branch information
antirez committed Sep 10, 2014
1 parent 9987180 commit 12b56a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/scripting.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -403,6 +400,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
if (c->argv != argv) {
zfree(c->argv);
argv = NULL;
argv_size = 0;
}

if (raise_error) {
Expand Down

0 comments on commit 12b56a9

Please sign in to comment.