From 66ff4bd102b0bfc8040a4d014884fe3abd6d0e24 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 2 Oct 2018 10:22:11 +0300 Subject: [PATCH] lib-master: ipc-client: Don't free command too early When multiple replies were received by IPC only the final reply should free the command. This may have caused e.g. "doveadm proxy list" to crash. Broken by 435f0545b200767c25a5daee17cd6b4998d03710 --- src/lib-master/ipc-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib-master/ipc-client.c b/src/lib-master/ipc-client.c index 93a2351dc3..546a733446 100644 --- a/src/lib-master/ipc-client.c +++ b/src/lib-master/ipc-client.c @@ -73,10 +73,10 @@ static void ipc_client_input_line(struct ipc_client *client, const char *line) else client->aborted_cmds_count--; } - if (cmd != NULL) { + if (cmd != NULL) cmd->callback(state, line, cmd->context); + if (state != IPC_CLIENT_CMD_STATE_REPLY) i_free(cmd); - } if (disconnect) ipc_client_disconnect(client); } -- 2.47.3