Unverified Commit 76784e4e authored by weiguo's avatar weiguo Committed by GitHub
Browse files

Use object size then pointer size when malloc (#10201) (#10202)

By a happy coincidence, sizeof(sds *) is equal to sizeof(sds) here,
while it's logically consistent to use sizeof(sds) instead.
parent 7a89e498
...@@ -2533,7 +2533,7 @@ void aclCommand(client *c) { ...@@ -2533,7 +2533,7 @@ void aclCommand(client *c) {
} }
int merged_argc = 0, invalid_idx = 0; int merged_argc = 0, invalid_idx = 0;
sds *temp_argv = zmalloc(c->argc * sizeof(sds *)); sds *temp_argv = zmalloc(c->argc * sizeof(sds));
for (int i = 3; i < c->argc; i++) temp_argv[i-3] = c->argv[i]->ptr; for (int i = 3; i < c->argc; i++) temp_argv[i-3] = c->argv[i]->ptr;
sds *acl_args = ACLMergeSelectorArguments(temp_argv, c->argc - 3, &merged_argc, &invalid_idx); sds *acl_args = ACLMergeSelectorArguments(temp_argv, c->argc - 3, &merged_argc, &invalid_idx);
zfree(temp_argv); zfree(temp_argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment