diff options
author | Harkrishn Patro <harkrisp@amazon.com> | 2022-07-04 10:09:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 10:09:27 -0700 |
commit | 9bcdd1537ed6404d4f9def35439af0589f1adf72 (patch) | |
tree | daa629aa18181b7b4812f4ec90c645166b168f89 /src/multi.c | |
parent | f620e6ac739191690fcd48dbbc8164ea256a95fc (diff) | |
download | redis-9bcdd1537ed6404d4f9def35439af0589f1adf72.tar.gz |
Avoid double multiplication of alloc_count (#10934)
Diffstat (limited to 'src/multi.c')
-rw-r--r-- | src/multi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multi.c b/src/multi.c index c1204cef3..5249c58bf 100644 --- a/src/multi.c +++ b/src/multi.c @@ -74,7 +74,7 @@ void queueMultiCommand(client *c, uint64_t cmd_flags) { } 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.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->cmd = c->cmd; |