From: Timo Sirainen Date: Tue, 2 Oct 2018 07:22:11 +0000 (+0300) Subject: lib-master: ipc-client: Don't free command too early X-Git-Tag: 2.2.36.1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=454e130ea23d02bcc6b8a114c0dd5e0967c57088;p=thirdparty%2Fdovecot%2Fcore.git 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 --- diff --git a/src/lib-master/ipc-client.c b/src/lib-master/ipc-client.c index 62d698919a..1ec89d44be 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); }