Skip to content

Commit

Permalink
lib-program-client: Do not call program_client_fail twice
Browse files Browse the repository at this point in the history
Fixes crash in program-client caused by use of freed memory.
  • Loading branch information
cmouse authored and sirainen committed Jan 9, 2017
1 parent d2cc2b0 commit 42d12a3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib-program-client/program-client.c
Expand Up @@ -73,18 +73,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
Expand Down

0 comments on commit 42d12a3

Please sign in to comment.