From: Aki Tuomi Date: Sun, 8 Jan 2017 16:44:32 +0000 (+0200) Subject: lib-program-client: Do not call program_client_fail twice X-Git-Tag: 2.3.0.rc1~2339 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c9ae3d919ba59af5be3193a80ece4871a0d700c;p=thirdparty%2Fdovecot%2Fcore.git lib-program-client: Do not call program_client_fail twice Fixes crash in program-client caused by use of freed memory. --- diff --git a/src/lib-program-client/program-client.c b/src/lib-program-client/program-client.c index 69cb74ac57..defe261c94 100644 --- a/src/lib-program-client/program-client.c +++ b/src/lib-program-client/program-client.c @@ -76,19 +76,12 @@ void program_client_connect_timeout(struct program_client *pclient) static int program_client_connect(struct program_client *pclient) { - int ret; - if (pclient->set.client_connect_timeout_msecs != 0) { pclient->to = timeout_add(pclient->set.client_connect_timeout_msecs, program_client_connect_timeout, pclient); } - if ((ret = pclient->connect(pclient)) < 0) { - program_client_fail(pclient, PROGRAM_CLIENT_ERROR_IO); - return -1; - } - - return ret; + return pclient->connect(pclient); } static