Skip to content

Commit

Permalink
doveadm: client - Cleanup: Handle input NULL first
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and Timo Sirainen committed Nov 15, 2017
1 parent 2063815 commit 9f869f9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/doveadm/server-connection.c
Expand Up @@ -354,7 +354,13 @@ static void server_connection_input(struct server_connection *conn)
}

while (!conn->authenticated) {
if ((line = i_stream_next_line(conn->input)) != NULL) {
if ((line = i_stream_next_line(conn->input)) == NULL) {
if (conn->input->eof || conn->input->stream_errno != 0) {
server_log_disconnect_error(conn);
server_connection_destroy(&conn);
}
return;
} else {
/* Allow VERSION before or after the "+" or "-" line,
because v2.2.33 sent the version after and newer
versions send before. */
Expand Down Expand Up @@ -393,12 +399,6 @@ static void server_connection_input(struct server_connection *conn)
server_connection_destroy(&conn);
return;
}
} else {
if (conn->input->eof || conn->input->stream_errno != 0) {
server_log_disconnect_error(conn);
server_connection_destroy(&conn);
}
return;
}
}

Expand Down

0 comments on commit 9f869f9

Please sign in to comment.