]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-redis: Don't crash if we get disconnected during an open transaction.
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 12:26:35 +0000 (15:26 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 12:26:35 +0000 (15:26 +0300)
src/lib-dict/dict-redis.c

index 5d71e2fc40518247b4391d6a686cbae7f06e1726..50b085af06f8537b0e1103668257c9fda6bfe829 100644 (file)
@@ -591,6 +591,11 @@ static int redis_check_transaction(struct redis_dict_transaction_context *ctx)
 
        if (ctx->failed)
                return -1;
+       if (!dict->connected) {
+               /* disconnected during transaction */
+               ctx->failed = TRUE;
+               return -1;
+       }
        if (ctx->ctx.changed)
                return 0;