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.
This commit is contained in:
weiguo 2022-01-29 20:43:16 +08:00 committed by GitHub
parent 7a89e49859
commit 76784e4ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2533,7 +2533,7 @@ void aclCommand(client *c) {
}
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;
sds *acl_args = ACLMergeSelectorArguments(temp_argv, c->argc - 3, &merged_argc, &invalid_idx);
zfree(temp_argv);