Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6fbcb192
Commit
6fbcb192
authored
Sep 10, 2014
by
antirez
Browse files
luaRedisGenericCommand() cached argv handling simplified.
As discussed in issue #1945.
parent
8375a6d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
6fbcb192
...
@@ -222,10 +222,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
...
@@ -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;
}
}
...
@@ -402,6 +399,7 @@ cleanup:
...
@@ -402,6 +399,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) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment