Skip to content

Commit

Permalink
Don't queue commands in an already aborted MULTI state
Browse files Browse the repository at this point in the history
  • Loading branch information
oranagra authored and antirez committed Jun 9, 2020
1 parent b35fdf1 commit e2046b3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ void queueMultiCommand(client *c) {
multiCmd *mc;
int j;

/* No sense to waste memory if the transaction is already aborted.
* this is useful in case client sends these in a pipeline, or doesn't
* bother to read previous responses and didn't notice the multi was already
* aborted. */
if (c->flags & CLIENT_DIRTY_EXEC)
return;

c->mstate.commands = zrealloc(c->mstate.commands,
sizeof(multiCmd)*(c->mstate.count+1));
mc = c->mstate.commands+c->mstate.count;
Expand Down

0 comments on commit e2046b3

Please sign in to comment.