$OpenBSD: patch-src_indexer_indexer-client_c,v 1.1 2021/08/16 17:43:21 sthen Exp $

commit 7784e710149c6834f2dab5453726f387597c52ad
Author: Timo Sirainen <timo.sirainen@open-xchange.com>
Date:   Mon Aug 9 13:01:12 2021 +0300

indexer: Fix crash if client disconnects while it's waiting for command reply

This happened for example if IMAP SEARCH triggered long fts indexing and the
IMAP client disconnected while waiting for the reply.

Broken by f62a25849358e40a08a2c47f5bcaa1613a31d076

Index: src/indexer/indexer-client.c
--- src/indexer/indexer-client.c.orig
+++ src/indexer/indexer-client.c
@@ -139,7 +139,7 @@ void indexer_client_status_callback(int percentage, vo
 	struct indexer_client_request *ctx = context;
 
 	/* we are in deinit already, or the client has disconnected */
-	if (ctx->client == NULL)
+	if (ctx->client->conn.output == NULL)
 		return;
 
 	T_BEGIN {
