From: Marco Bettini Date: Fri, 11 Feb 2022 08:17:58 +0000 (+0100) Subject: indexer: indexer_client_status_callback() - Fix accessing freed memory X-Git-Tag: 2.3.19~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=feebfa572ab8d65ecc10de76427d70e3e86f6550;p=thirdparty%2Fdovecot%2Fcore.git indexer: indexer_client_status_callback() - Fix accessing freed memory Broken by a9683d7b3 --- diff --git a/src/indexer/indexer-client.c b/src/indexer/indexer-client.c index bd65b5efc5..ea557c0329 100644 --- a/src/indexer/indexer-client.c +++ b/src/indexer/indexer-client.c @@ -138,14 +138,7 @@ void indexer_client_status_callback(int percentage, void *context) { struct indexer_client_request *ctx = context; - /* we are in deinit already, or the client has disconnected */ - if (ctx->client->conn.output == NULL) { - indexer_client_unref(ctx->client); - i_free(ctx); - return; - } - - T_BEGIN { + if (ctx->client->conn.output != NULL) T_BEGIN { o_stream_nsend_str(ctx->client->conn.output, t_strdup_printf("%u\t%d\n", ctx->tag, percentage)); } T_END;