Unverified Commit 9bcdd153 authored by Harkrishn Patro's avatar Harkrishn Patro Committed by GitHub
Browse files

Avoid double multiplication of alloc_count (#10934)

parent f620e6ac
...@@ -74,7 +74,7 @@ void queueMultiCommand(client *c, uint64_t cmd_flags) { ...@@ -74,7 +74,7 @@ void queueMultiCommand(client *c, uint64_t cmd_flags) {
} }
if (c->mstate.count == c->mstate.alloc_count) { if (c->mstate.count == c->mstate.alloc_count) {
c->mstate.alloc_count = c->mstate.alloc_count < INT_MAX/2 ? c->mstate.alloc_count*2 : INT_MAX; c->mstate.alloc_count = c->mstate.alloc_count < INT_MAX/2 ? c->mstate.alloc_count*2 : INT_MAX;
c->mstate.commands = zrealloc(c->mstate.commands, sizeof(multiCmd)*(c->mstate.alloc_count*2)); c->mstate.commands = zrealloc(c->mstate.commands, sizeof(multiCmd)*(c->mstate.alloc_count));
} }
mc = c->mstate.commands+c->mstate.count; mc = c->mstate.commands+c->mstate.count;
mc->cmd = c->cmd; mc->cmd = c->cmd;
......
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