From: Josef 'Jeff' Sipek Date: Tue, 6 Jun 2017 09:28:07 +0000 (+0300) Subject: global: start relying on io_remove{,_closed}(NULL) being a no-op X-Git-Tag: 2.3.0.rc1~986 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f1d689131a75c39f064cbd4202373e7edf78f18;p=thirdparty%2Fdovecot%2Fcore.git global: start relying on io_remove{,_closed}(NULL) being a no-op Cleanup performed with the following semantic patch: @@ expression E; @@ - if (E != NULL) { - io_remove(&E); - } + io_remove(&E); @@ expression E; @@ - if (E != NULL) { - io_remove_closed(&E); - } + io_remove_closed(&E); --- diff --git a/src/anvil/main.c b/src/anvil/main.c index fd99680a7e..dc9ca2378f 100644 --- a/src/anvil/main.c +++ b/src/anvil/main.c @@ -80,8 +80,7 @@ int main(int argc, char *argv[]) master_service_run(master_service, client_connected); - if (log_fdpass_io != NULL) - io_remove(&log_fdpass_io); + io_remove(&log_fdpass_io); penalty_deinit(&penalty); connect_limit_deinit(&connect_limit); anvil_connections_destroy_all(); diff --git a/src/auth/auth-client-connection.c b/src/auth/auth-client-connection.c index cfa0073f35..a05327fb92 100644 --- a/src/auth/auth-client-connection.c +++ b/src/auth/auth-client-connection.c @@ -76,8 +76,7 @@ static void auth_client_send(struct auth_client_connection *conn, OUTBUF_THROTTLE_SIZE) { /* stop reading new requests until client has read the pending replies. */ - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); } if (conn->auth->set->debug) { @@ -371,8 +370,7 @@ void auth_client_connection_destroy(struct auth_client_connection **_conn) i_stream_close(conn->input); o_stream_close(conn->output); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); net_disconnect(conn->fd); conn->fd = -1; diff --git a/src/auth/auth-master-connection.c b/src/auth/auth-master-connection.c index a9de7c4473..eadc8431c3 100644 --- a/src/auth/auth-master-connection.c +++ b/src/auth/auth-master-connection.c @@ -786,8 +786,7 @@ void auth_master_connection_destroy(struct auth_master_connection **_conn) i_stream_close(conn->input); if (conn->output != NULL) o_stream_close(conn->output); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->fd != -1) { if (close(conn->fd) < 0) i_error("close(%s): %m", conn->path); diff --git a/src/auth/auth-postfix-connection.c b/src/auth/auth-postfix-connection.c index ad30ed7cda..18592e5536 100644 --- a/src/auth/auth-postfix-connection.c +++ b/src/auth/auth-postfix-connection.c @@ -200,8 +200,7 @@ auth_postfix_connection_destroy(struct auth_postfix_connection **_conn) i_stream_close(conn->input); if (conn->output != NULL) o_stream_close(conn->output); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->fd != -1) { if (close(conn->fd) < 0) i_error("close(%s): %m", conn->path); diff --git a/src/auth/auth-worker-client.c b/src/auth/auth-worker-client.c index 7b182ad329..4fa775b7eb 100644 --- a/src/auth/auth-worker-client.c +++ b/src/auth/auth-worker-client.c @@ -71,8 +71,7 @@ auth_worker_client_check_throttle(struct auth_worker_client *client) OUTBUF_THROTTLE_SIZE) { /* stop reading new requests until client has read the pending replies. */ - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); } } @@ -790,8 +789,7 @@ void auth_worker_client_destroy(struct auth_worker_client **_client) if (client->to_idle != NULL) timeout_remove(&client->to_idle); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); net_disconnect(client->fd); client->fd = -1; diff --git a/src/auth/auth-worker-server.c b/src/auth/auth-worker-server.c index 318fa913e6..be905cf4bb 100644 --- a/src/auth/auth-worker-server.c +++ b/src/auth/auth-worker-server.c @@ -240,8 +240,7 @@ static void auth_worker_destroy(struct auth_worker_connection **_conn, conn->request->context); } - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); i_stream_destroy(&conn->input); o_stream_destroy(&conn->output); if (conn->to != NULL) diff --git a/src/auth/db-checkpassword.c b/src/auth/db-checkpassword.c index 8b60c00dc0..1f2ebb03ae 100644 --- a/src/auth/db-checkpassword.c +++ b/src/auth/db-checkpassword.c @@ -63,10 +63,8 @@ env_put_extra_fields(const ARRAY_TYPE(auth_field) *extra_fields) static void checkpassword_request_close(struct chkpw_auth_request *request) { - if (request->io_in != NULL) - io_remove(&request->io_in); - if (request->io_out != NULL) - io_remove(&request->io_out); + io_remove(&request->io_in); + io_remove(&request->io_out); if (request->fd_in != -1) { if (close(request->fd_in) < 0) diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 69f772be5a..5bf9fa4b56 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -1287,8 +1287,7 @@ void db_ldap_connect_delayed(struct ldap_connection *conn) void db_ldap_enable_input(struct ldap_connection *conn, bool enable) { if (!enable) { - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); } else { if (conn->io == NULL && conn->fd != -1) { conn->io = io_add(conn->fd, IO_READ, ldap_input, conn); @@ -1338,11 +1337,9 @@ static void db_ldap_conn_close(struct ldap_connection *conn) } conn->fd = -1; - if (conn->io != NULL) { - /* the fd may have already been closed before ldap_unbind(), - so we'll have to use io_remove_closed(). */ - io_remove_closed(&conn->io); - } + /* the fd may have already been closed before ldap_unbind(), + so we'll have to use io_remove_closed(). */ + io_remove_closed(&conn->io); if (aqueue_count(conn->request_queue) > 0) { conn->to = timeout_add(DB_LDAP_REQUEST_DISCONNECT_TIMEOUT_SECS * diff --git a/src/dict/dict-connection.c b/src/dict/dict-connection.c index ac8e34e7f1..e171adab1e 100644 --- a/src/dict/dict-connection.c +++ b/src/dict/dict-connection.c @@ -291,8 +291,7 @@ void dict_connection_destroy(struct dict_connection *conn) if (conn->to_input != NULL) timeout_remove(&conn->to_input); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); i_stream_close(conn->input); o_stream_close(conn->output); if (close(conn->fd) < 0) diff --git a/src/director/director-connection.c b/src/director/director-connection.c index f01b031f54..40f1eb5dd6 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -2191,8 +2191,7 @@ void director_connection_deinit(struct director_connection **_conn, if (conn->to_pong != NULL) timeout_remove(&conn->to_pong); timeout_remove(&conn->to_ping); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); i_stream_unref(&conn->input); o_stream_unref(&conn->output); if (close(conn->fd) < 0) diff --git a/src/director/director-test.c b/src/director/director-test.c index b43a313819..fb9428bc84 100644 --- a/src/director/director-test.c +++ b/src/director/director-test.c @@ -370,14 +370,12 @@ static void director_connection_destroy(struct director_connection **_conn) if (conn->to_delay != NULL) timeout_remove(&conn->to_delay); - if (conn->in_io != NULL) - io_remove(&conn->in_io); + io_remove(&conn->in_io); i_stream_unref(&conn->in_input); o_stream_unref(&conn->in_output); net_disconnect(conn->in_fd); - if (conn->out_io != NULL) - io_remove(&conn->out_io); + io_remove(&conn->out_io); i_stream_unref(&conn->out_input); o_stream_unref(&conn->out_output); net_disconnect(conn->out_fd); diff --git a/src/doveadm/client-connection.c b/src/doveadm/client-connection.c index 3deca328d6..d6f7d4a432 100644 --- a/src/doveadm/client-connection.c +++ b/src/doveadm/client-connection.c @@ -570,9 +570,7 @@ void client_connection_destroy(struct client_connection **_conn) if (conn->output != NULL) o_stream_destroy(&conn->output); - if (conn->io != NULL) { - io_remove(&conn->io); - } + io_remove(&conn->io); if (conn->input != NULL) { i_stream_destroy(&conn->input); diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index 3235e65dad..3db44c5936 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -126,8 +126,7 @@ static void remote_error_input(struct dsync_cmd_context *ctx) i_stream_skip(ctx->err_stream, size); break; case -1: - if (ctx->io_err != NULL) - io_remove(&ctx->io_err); + io_remove(&ctx->io_err); break; default: while ((line = i_stream_next_line(ctx->err_stream)) != NULL) @@ -733,8 +732,7 @@ cmd_dsync_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user) } else { i_assert(ctx->err_stream == NULL); } - if (ctx->io_err != NULL) - io_remove(&ctx->io_err); + io_remove(&ctx->io_err); i_close_fd(&ctx->fd_err); if (ctx->child_wait != NULL) diff --git a/src/doveadm/dsync/dsync-ibc-stream.c b/src/doveadm/dsync/dsync-ibc-stream.c index 878013821f..454c7bbc4d 100644 --- a/src/doveadm/dsync/dsync-ibc-stream.c +++ b/src/doveadm/dsync/dsync-ibc-stream.c @@ -388,8 +388,7 @@ static void dsync_ibc_stream_deinit(struct dsync_ibc *_ibc) } timeout_remove(&ibc->to); - if (ibc->io != NULL) - io_remove(&ibc->io); + io_remove(&ibc->io); i_stream_destroy(&ibc->input); o_stream_destroy(&ibc->output); pool_unref(&ibc->ret_pool); diff --git a/src/doveadm/server-connection.c b/src/doveadm/server-connection.c index 3d953fd504..e3bbd58f75 100644 --- a/src/doveadm/server-connection.c +++ b/src/doveadm/server-connection.c @@ -564,8 +564,7 @@ void server_connection_destroy(struct server_connection **_conn) o_stream_destroy(&conn->cmd_output); if (conn->ssl_iostream != NULL) ssl_iostream_unref(&conn->ssl_iostream); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->fd != -1) { if (close(conn->fd) < 0) i_error("close(server) failed: %m"); @@ -618,7 +617,6 @@ void server_connection_extract(struct server_connection *conn, conn->input = NULL; conn->output = NULL; conn->ssl_iostream = NULL; - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); conn->fd = -1; } diff --git a/src/imap-hibernate/imap-client.c b/src/imap-hibernate/imap-client.c index 6b770ba3fc..f61f8666aa 100644 --- a/src/imap-hibernate/imap-client.c +++ b/src/imap-hibernate/imap-client.c @@ -586,14 +586,12 @@ static void imap_client_stop(struct imap_client *client) if (client->unhibernate_queued) priorityq_remove(unhibernate_queue, &client->item); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->to_keepalive != NULL) timeout_remove(&client->to_keepalive); array_foreach_modifiable(&client->notifys, notify) { - if (notify->io != NULL) - io_remove(¬ify->io); + io_remove(¬ify->io); i_close_fd(¬ify->fd); } } diff --git a/src/imap-urlauth/imap-urlauth-client.c b/src/imap-urlauth/imap-urlauth-client.c index a7dc1ac258..5fbe3cff21 100644 --- a/src/imap-urlauth/imap-urlauth-client.c +++ b/src/imap-urlauth/imap-urlauth-client.c @@ -191,8 +191,7 @@ void client_worker_disconnect(struct client *client) { client->worker_state = IMAP_URLAUTH_WORKER_STATE_INACTIVE; - if (client->ctrl_io != NULL) - io_remove(&client->ctrl_io); + io_remove(&client->ctrl_io); if (client->ctrl_output != NULL) o_stream_destroy(&client->ctrl_output); if (client->ctrl_input != NULL) diff --git a/src/imap-urlauth/imap-urlauth-worker.c b/src/imap-urlauth/imap-urlauth-worker.c index 3036cbed6d..b5f60e1aa0 100644 --- a/src/imap-urlauth/imap-urlauth-worker.c +++ b/src/imap-urlauth/imap-urlauth-worker.c @@ -238,10 +238,8 @@ static void client_destroy(struct client *client) if (client->mail_user != NULL) mail_user_unref(&client->mail_user); - if (client->io != NULL) - io_remove(&client->io); - if (client->ctrl_io != NULL) - io_remove(&client->ctrl_io); + io_remove(&client->io); + io_remove(&client->ctrl_io); if (client->to_idle != NULL) timeout_remove(&client->to_idle); diff --git a/src/imap/cmd-append.c b/src/imap/cmd-append.c index e9943c264b..d9d2037d3b 100644 --- a/src/imap/cmd-append.c +++ b/src/imap/cmd-append.c @@ -134,8 +134,7 @@ static void cmd_append_finish(struct cmd_append_context *ctx) i_assert(ctx->client->input_lock == ctx->cmd); - if (ctx->client->io != NULL) - io_remove(&ctx->client->io); + io_remove(&ctx->client->io); /* we must put back the original flush callback before beginning to sync (the command is still unfinished at that point) */ o_stream_set_flush_callback(ctx->client->output, diff --git a/src/imap/cmd-idle.c b/src/imap/cmd-idle.c index bdb733a3e8..092bc83b34 100644 --- a/src/imap/cmd-idle.c +++ b/src/imap/cmd-idle.c @@ -39,8 +39,7 @@ idle_finish(struct cmd_idle_context *ctx, bool done_ok, bool free_cmd) } o_stream_cork(client->output); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->mailbox != NULL) mailbox_notify_changes_stop(client->mailbox); diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 699a2aa104..0efc4e9cc8 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -432,8 +432,7 @@ static void client_default_destroy(struct client *client, const char *reason) if (client->free_parser != NULL) imap_parser_unref(&client->free_parser); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->to_idle_output != NULL) timeout_remove(&client->to_idle_output); if (client->to_delayed_input != NULL) diff --git a/src/ipc/client.c b/src/ipc/client.c index 47fa168ec2..14f0e71697 100644 --- a/src/ipc/client.c +++ b/src/ipc/client.c @@ -137,8 +137,7 @@ void client_destroy(struct client **_client) *_client = NULL; DLLIST_REMOVE(&clients, client); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); i_stream_destroy(&client->input); o_stream_destroy(&client->output); if (close(client->fd) < 0) diff --git a/src/lib-auth/auth-server-connection.c b/src/lib-auth/auth-server-connection.c index a313888d95..71d2df1550 100644 --- a/src/lib-auth/auth-server-connection.c +++ b/src/lib-auth/auth-server-connection.c @@ -359,8 +359,7 @@ void auth_server_connection_disconnect(struct auth_server_connection *conn, if (conn->to != NULL) timeout_remove(&conn->to); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->fd != -1) { i_stream_destroy(&conn->input); o_stream_destroy(&conn->output); diff --git a/src/lib-dns/dns-lookup.c b/src/lib-dns/dns-lookup.c index 0b51bdfa99..3866dfa1f5 100644 --- a/src/lib-dns/dns-lookup.c +++ b/src/lib-dns/dns-lookup.c @@ -61,8 +61,7 @@ static void dns_client_disconnect(struct dns_client *client, const char *error) if (client->to_idle != NULL) timeout_remove(&client->to_idle); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->input != NULL) i_stream_destroy(&client->input); if (client->fd != -1) { diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 181bb2f126..814de2b40f 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -1546,8 +1546,7 @@ http_client_connection_disconnect(struct http_client_connection *conn) if (conn->connect_initialized) connection_disconnect(&conn->conn); - if (conn->io_req_payload != NULL) - io_remove(&conn->io_req_payload); + io_remove(&conn->io_req_payload); if (conn->to_requests != NULL) timeout_remove(&conn->to_requests); if (conn->to_connect != NULL) diff --git a/src/lib-http/http-client-request.c b/src/lib-http/http-client-request.c index 21c0a90917..4dadbcb26e 100644 --- a/src/lib-http/http-client-request.c +++ b/src/lib-http/http-client-request.c @@ -1008,8 +1008,7 @@ static void http_client_request_payload_input(struct http_client_request *req) { struct http_client_connection *conn = req->conn; - if (conn->io_req_payload != NULL) - io_remove(&conn->io_req_payload); + io_remove(&conn->io_req_payload); (void)http_client_connection_output(conn); } @@ -1024,8 +1023,7 @@ int http_client_request_send_more(struct http_client_request *req, i_assert(req->payload_input != NULL); i_assert(req->payload_output != NULL); - if (conn->io_req_payload != NULL) - io_remove(&conn->io_req_payload); + io_remove(&conn->io_req_payload); /* chunked ostream needs to write to the parent stream's buffer */ o_stream_set_max_buffer_size(output, IO_BLOCK_SIZE); diff --git a/src/lib-http/http-server-connection.c b/src/lib-http/http-server-connection.c index 707939f925..c471b096bd 100644 --- a/src/lib-http/http-server-connection.c +++ b/src/lib-http/http-server-connection.c @@ -107,8 +107,7 @@ http_server_connection_get_stats(struct http_server_connection *conn) static void http_server_connection_input_halt(struct http_server_connection *conn) { - if (conn->conn.io != NULL) - io_remove(&conn->conn.io); + io_remove(&conn->conn.io); } static void @@ -1169,8 +1168,7 @@ http_server_connection_disconnect(struct http_server_connection *conn, timeout_remove(&conn->to_input); http_server_connection_timeout_stop(conn); - if (conn->io_resp_payload != NULL) - io_remove(&conn->io_resp_payload); + io_remove(&conn->io_resp_payload); if (conn->conn.output != NULL) { o_stream_nflush(conn->conn.output); o_stream_uncork(conn->conn.output); diff --git a/src/lib-http/http-server-response.c b/src/lib-http/http-server-response.c index b62705ffd9..f2ecff488a 100644 --- a/src/lib-http/http-server-response.c +++ b/src/lib-http/http-server-response.c @@ -470,8 +470,7 @@ http_server_response_payload_input(struct http_server_response *resp) { struct http_server_connection *conn = resp->request->conn; - if (conn->io_resp_payload != NULL) - io_remove(&conn->io_resp_payload); + io_remove(&conn->io_resp_payload); (void)http_server_connection_output(conn); } @@ -490,8 +489,7 @@ int http_server_response_send_more(struct http_server_response *resp, i_assert(resp->payload_input != NULL); i_assert(resp->payload_output != NULL); - if (conn->io_resp_payload != NULL) - io_remove(&conn->io_resp_payload); + io_remove(&conn->io_resp_payload); /* chunked ostream needs to write to the parent stream's buffer */ o_stream_set_max_buffer_size(output, IO_BLOCK_SIZE); diff --git a/src/lib-http/test-http-payload.c b/src/lib-http/test-http-payload.c index 4a67606ab8..06abb21f18 100644 --- a/src/lib-http/test-http-payload.c +++ b/src/lib-http/test-http-payload.c @@ -647,8 +647,7 @@ test_client_request_new(void) static void test_client_request_destroy(struct test_client_request *tcreq) { - if (tcreq->io != NULL) - io_remove(&tcreq->io); + io_remove(&tcreq->io); if (tcreq->payload != NULL) i_stream_unref(&tcreq->payload); if (tcreq->file != NULL) diff --git a/src/lib-http/test-http-server-errors.c b/src/lib-http/test-http-server-errors.c index 450e365175..1fb4d6f3ff 100644 --- a/src/lib-http/test-http-server-errors.c +++ b/src/lib-http/test-http-server-errors.c @@ -222,8 +222,7 @@ static void test_server_hanging_request_payload_destroyed(struct _hanging_request_payload *ctx) { test_assert(!ctx->serviced); - if (ctx->io != NULL) - io_remove(&ctx->io); + io_remove(&ctx->io); i_free(ctx); io_loop_stop(ioloop); } @@ -358,8 +357,7 @@ static void test_server_hanging_response_payload_destroyed(struct _hanging_response_payload *ctx) { test_assert(!ctx->serviced); - if (ctx->io != NULL) - io_remove(&ctx->io); + io_remove(&ctx->io); i_free(ctx); io_loop_stop(ioloop); } diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index 1018464a82..ba503527c6 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -448,8 +448,7 @@ void imapc_connection_disconnect_full(struct imapc_connection *conn, timeout_remove(&conn->to_throttle_shrink); if (conn->parser != NULL) imap_parser_unref(&conn->parser); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->ssl_iostream != NULL) ssl_iostream_unref(&conn->ssl_iostream); if (conn->fd != -1) { @@ -1668,8 +1667,7 @@ static void imapc_connection_connected(struct imapc_connection *conn) struct ip_addr local_ip; in_port_t local_port; int err; - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); err = net_geterror(conn->fd); if (err != 0) { diff --git a/src/lib-master/master-auth.c b/src/lib-master/master-auth.c index 55c5c8c7bf..de476ab715 100644 --- a/src/lib-master/master-auth.c +++ b/src/lib-master/master-auth.c @@ -71,8 +71,7 @@ master_auth_connection_deinit(struct master_auth_connection **_conn) if (conn->to != NULL) timeout_remove(&conn->to); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->fd != -1) { if (close(conn->fd) < 0) i_fatal("close(%s) failed: %m", conn->path); diff --git a/src/lib-master/master-login-auth.c b/src/lib-master/master-login-auth.c index b6a6d2300a..5f6dfd57b8 100644 --- a/src/lib-master/master-login-auth.c +++ b/src/lib-master/master-login-auth.c @@ -107,8 +107,7 @@ void master_login_auth_disconnect(struct master_login_auth *auth) if (auth->to != NULL) timeout_remove(&auth->to); - if (auth->io != NULL) - io_remove(&auth->io); + io_remove(&auth->io); if (auth->fd != -1) { if (auth->input != NULL) i_stream_destroy(&auth->input); diff --git a/src/lib-master/master-login.c b/src/lib-master/master-login.c index e173fa39c2..60e8bfcbd9 100644 --- a/src/lib-master/master-login.c +++ b/src/lib-master/master-login.c @@ -470,8 +470,7 @@ static void master_login_conn_close(struct master_login_connection *conn) DLLIST_REMOVE(&conn->login->conns, conn); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); o_stream_close(conn->output); if (close(conn->fd) < 0) i_error("close(master login) failed: %m"); diff --git a/src/lib-master/master-service-haproxy.c b/src/lib-master/master-service-haproxy.c index aecab4a93c..4438b5925d 100644 --- a/src/lib-master/master-service-haproxy.c +++ b/src/lib-master/master-service-haproxy.c @@ -76,8 +76,7 @@ master_service_haproxy_conn_free(struct master_service_haproxy_conn *hpconn) DLLIST_REMOVE(&service->haproxy_conns, hpconn); - if (hpconn->io != NULL) - io_remove(&hpconn->io); + io_remove(&hpconn->io); if (hpconn->to != NULL) timeout_remove(&hpconn->to); i_free(hpconn); diff --git a/src/lib-master/master-service.c b/src/lib-master/master-service.c index ccea531576..6e66917abd 100644 --- a/src/lib-master/master-service.c +++ b/src/lib-master/master-service.c @@ -959,10 +959,8 @@ void master_service_deinit(struct master_service **_service) timeout_remove(&service->to_overflow_state); if (service->to_status != NULL) timeout_remove(&service->to_status); - if (service->io_status_error != NULL) - io_remove(&service->io_status_error); - if (service->io_status_write != NULL) - io_remove(&service->io_status_write); + io_remove(&service->io_status_error); + io_remove(&service->io_status_write); if (array_is_created(&service->config_overrides)) array_free(&service->config_overrides); @@ -1076,8 +1074,7 @@ void master_service_io_listeners_remove(struct master_service *service) unsigned int i; for (i = 0; i < service->socket_count; i++) { - if (service->listeners[i].io != NULL) - io_remove(&service->listeners[i].io); + io_remove(&service->listeners[i].io); } } @@ -1130,10 +1127,7 @@ master_status_send(struct master_service *service, bool important_update) sizeof(service->master_status)); if (ret == sizeof(service->master_status)) { /* success */ - if (service->io_status_write != NULL) { - /* delayed important update sent successfully */ - io_remove(&service->io_status_write); - } + io_remove(&service->io_status_write); service->last_sent_status_time = ioloop_time; service->last_sent_status_avail_count = service->master_status.available_count; diff --git a/src/lib-program-client/program-client.c b/src/lib-program-client/program-client.c index 987255f174..09517e8c90 100644 --- a/src/lib-program-client/program-client.c +++ b/src/lib-program-client/program-client.c @@ -111,8 +111,7 @@ void program_client_disconnect_extra_fds(struct program_client *pclient) for(i = 0; i < count; i++) { if (efds[i].input != NULL) i_stream_unref(&efds[i].input); - if (efds[i].io != NULL) - io_remove(&efds[i].io); + io_remove(&efds[i].io); if (efds[i].parent_fd != -1 && close(efds[i].parent_fd) < 0) i_error("close(fd=%d) failed: %m", efds[i].parent_fd); } @@ -130,8 +129,7 @@ void program_client_disconnected(struct program_client *pclient) if (pclient->program_output != NULL) o_stream_destroy(&pclient->program_output); - if (pclient->io != NULL) - io_remove(&pclient->io); + io_remove(&pclient->io); if (pclient->fd_in != -1 && close(pclient->fd_in) < 0) i_error("close(%s) failed: %m", pclient->path); @@ -164,8 +162,7 @@ void program_client_disconnect(struct program_client *pclient, bool force) if (pclient->to != NULL) timeout_remove(&pclient->to); - if (pclient->io != NULL) - io_remove(&pclient->io); + io_remove(&pclient->io); if ((ret = program_client_close_output(pclient)) < 0) pclient->other_error = TRUE; @@ -588,8 +585,7 @@ void program_client_destroy(struct program_client **_pclient) if (pclient->seekable_output != NULL) i_stream_unref(&pclient->seekable_output); - if (pclient->io != NULL) - io_remove(&pclient->io); + io_remove(&pclient->io); i_free(pclient->temp_prefix); if (pclient->destroy != NULL) diff --git a/src/lib-program-client/test-program-client-net.c b/src/lib-program-client/test-program-client-net.c index 6471e67312..d2048603a6 100644 --- a/src/lib-program-client/test-program-client-net.c +++ b/src/lib-program-client/test-program-client-net.c @@ -85,8 +85,7 @@ void test_program_client_destroy(struct test_client **_client) if (o_stream_nfinish(client->out) != 0) i_error("output error: %s", o_stream_get_error(client->out)); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); o_stream_unref(&client->out); i_stream_unref(&client->in); if (client->os_body != NULL) diff --git a/src/lib-program-client/test-program-client-unix.c b/src/lib-program-client/test-program-client-unix.c index 984bbdf860..2a9fd1fa8a 100644 --- a/src/lib-program-client/test-program-client-unix.c +++ b/src/lib-program-client/test-program-client-unix.c @@ -68,8 +68,7 @@ void test_program_client_destroy(struct test_client **_client) if (o_stream_nfinish(client->out) != 0) i_error("output error: %s", o_stream_get_error(client->out)); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); o_stream_unref(&client->out); i_stream_unref(&client->in); if (client->os_body != NULL) diff --git a/src/lib-smtp/lmtp-client.c b/src/lib-smtp/lmtp-client.c index 9c2beb34f3..c8bdc5190f 100644 --- a/src/lib-smtp/lmtp-client.c +++ b/src/lib-smtp/lmtp-client.c @@ -120,8 +120,7 @@ void lmtp_client_close(struct lmtp_client *client) dns_lookup_abort(&client->dns_lookup); if (client->to != NULL) timeout_remove(&client->to); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->input != NULL) i_stream_close(client->input); if (client->output != NULL) diff --git a/src/lib-sql/driver-cassandra.c b/src/lib-sql/driver-cassandra.c index ec79fdd69c..9c55750d8b 100644 --- a/src/lib-sql/driver-cassandra.c +++ b/src/lib-sql/driver-cassandra.c @@ -276,8 +276,7 @@ static void driver_cassandra_close(struct cassandra_db *db, const char *error) struct cassandra_sql_prepared_statement *const *prep_stmtp; struct cassandra_result *const *resultp; - if (db->io_pipe != NULL) - io_remove(&db->io_pipe); + io_remove(&db->io_pipe); if (db->fd_pipe[0] != -1) { i_close_fd(&db->fd_pipe[0]); i_close_fd(&db->fd_pipe[1]); diff --git a/src/lib-storage/index/pop3c/pop3c-client.c b/src/lib-storage/index/pop3c/pop3c-client.c index bce45ce676..c0f4e43576 100644 --- a/src/lib-storage/index/pop3c/pop3c-client.c +++ b/src/lib-storage/index/pop3c/pop3c-client.c @@ -201,8 +201,7 @@ static void pop3c_client_disconnect(struct pop3c_client *client) dns_lookup_abort(&client->dns_lookup); if (client->to != NULL) timeout_remove(&client->to); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->input != NULL) i_stream_destroy(&client->input); if (client->output != NULL) diff --git a/src/lib-storage/list/mailbox-list-index-notify.c b/src/lib-storage/list/mailbox-list-index-notify.c index d121ff50ad..21c0471e2e 100644 --- a/src/lib-storage/list/mailbox-list-index-notify.c +++ b/src/lib-storage/list/mailbox-list-index-notify.c @@ -179,10 +179,8 @@ void mailbox_list_index_notify_deinit(struct mailbox_list_notify *notify) mailbox_free(&inotify->inbox); if (inotify->subscriptions != NULL) mailbox_tree_deinit(&inotify->subscriptions); - if (inotify->io_wait != NULL) - io_remove(&inotify->io_wait); - if (inotify->io_wait_inbox != NULL) - io_remove(&inotify->io_wait_inbox); + io_remove(&inotify->io_wait); + io_remove(&inotify->io_wait_inbox); if (inotify->to_wait != NULL) timeout_remove(&inotify->to_wait); if (inotify->to_notify != NULL) @@ -927,10 +925,8 @@ void mailbox_list_index_notify_wait(struct mailbox_list_notify *notify, inotify->wait_context = context; if (callback == NULL) { - if (inotify->io_wait != NULL) - io_remove(&inotify->io_wait); - if (inotify->io_wait_inbox != NULL) - io_remove(&inotify->io_wait_inbox); + io_remove(&inotify->io_wait); + io_remove(&inotify->io_wait_inbox); if (inotify->to_wait != NULL) timeout_remove(&inotify->to_wait); if (inotify->to_notify != NULL) diff --git a/src/lib-storage/mailbox-watch.c b/src/lib-storage/mailbox-watch.c index 35f4e4151f..67c74e287a 100644 --- a/src/lib-storage/mailbox-watch.c +++ b/src/lib-storage/mailbox-watch.c @@ -93,8 +93,7 @@ void mailbox_watch_remove_all(struct mailbox *box) file = box->notify_files; box->notify_files = file->next; - if (file->io_notify != NULL) - io_remove(&file->io_notify); + io_remove(&file->io_notify); i_free(file->path); i_free(file); } diff --git a/src/lib/connection.c b/src/lib/connection.c index 2ea849b6e9..bce059cc7f 100644 --- a/src/lib/connection.c +++ b/src/lib/connection.c @@ -313,8 +313,7 @@ void connection_disconnect(struct connection *conn) i_zero(&conn->last_input_tv); if (conn->to != NULL) timeout_remove(&conn->to); - if (conn->io != NULL) - io_remove(&conn->io); + io_remove(&conn->io); if (conn->input != NULL) { i_stream_close(conn->input); i_stream_destroy(&conn->input); diff --git a/src/lib/ioloop-notify-inotify.c b/src/lib/ioloop-notify-inotify.c index c8478872c9..7cc93fbed4 100644 --- a/src/lib/ioloop-notify-inotify.c +++ b/src/lib/ioloop-notify-inotify.c @@ -234,8 +234,7 @@ int io_loop_extract_notify_fd(struct ioloop *ioloop) } for (io = ctx->fd_ctx.notifies; io != NULL; io = io->next) io->fd = -1; - if (ctx->event_io != NULL) - io_remove(&ctx->event_io); + io_remove(&ctx->event_io); fd = ctx->inotify_fd; ctx->inotify_fd = new_inotify_fd; return fd; diff --git a/src/lib/ioloop-notify-kqueue.c b/src/lib/ioloop-notify-kqueue.c index e7d8da5210..57c039cd29 100644 --- a/src/lib/ioloop-notify-kqueue.c +++ b/src/lib/ioloop-notify-kqueue.c @@ -118,8 +118,7 @@ void io_loop_notify_handler_deinit(struct ioloop *ioloop) io_remove(&_io); } - if (ctx->event_io) - io_remove(&ctx->event_io); + io_remove(&ctx->event_io); if (close(ctx->kq) < 0) i_error("close(kqueue notify) failed: %m"); i_free(ctx); @@ -217,8 +216,7 @@ int io_loop_extract_notify_fd(struct ioloop *ioloop) } for (io = ctx->notifies; io != NULL; io = io->next) io->fd = -1; - if (ctx->event_io != NULL) - io_remove(&ctx->event_io); + io_remove(&ctx->event_io); fd = ctx->kq; ctx->kq = new_kq; return fd; diff --git a/src/lib/iostream-pump.c b/src/lib/iostream-pump.c index f5e6e0fb7f..1d3901187d 100644 --- a/src/lib/iostream-pump.c +++ b/src/lib/iostream-pump.c @@ -168,8 +168,7 @@ void iostream_pump_stop(struct iostream_pump *pump) o_stream_unset_flush_callback(pump->output); - if (pump->io != NULL) - io_remove(&pump->io); + io_remove(&pump->io); } void iostream_pump_switch_ioloop(struct iostream_pump *pump) diff --git a/src/lib/ostream-file.c b/src/lib/ostream-file.c index 0c5d1c116c..8b0fe8d364 100644 --- a/src/lib/ostream-file.c +++ b/src/lib/ostream-file.c @@ -34,8 +34,7 @@ static struct ostream * o_stream_create_fd_common(int fd, static void stream_closed(struct file_ostream *fstream) { - if (fstream->io != NULL) - io_remove(&fstream->io); + io_remove(&fstream->io); if (fstream->autoclose_fd && fstream->fd != -1) { if (close(fstream->fd) < 0) { @@ -485,10 +484,7 @@ static void stream_send_io(struct file_ostream *fstream) fstream->flush_pending = TRUE; if (!fstream->flush_pending && IS_STREAM_EMPTY(fstream)) { - if (fstream->io != NULL) { - /* all sent */ - io_remove(&fstream->io); - } + io_remove(&fstream->io); } else if (!fstream->ostream.ostream.closed) { /* Add the IO handler if it's not there already. Callback might have just returned 0 without there being any data diff --git a/src/lmtp/client.c b/src/lmtp/client.c index ad29a3971f..23cfc00e3c 100644 --- a/src/lmtp/client.c +++ b/src/lmtp/client.c @@ -226,8 +226,7 @@ const char *client_remote_id(struct client *client) void client_io_reset(struct client *client) { - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->to_idle != NULL) timeout_remove(&client->to_idle); client->io = io_add(client->fd_in, IO_READ, client_input, client); @@ -295,8 +294,7 @@ void client_destroy(struct client *client, const char *prefix, mail_user_unref(&client->raw_mail_user); if (client->proxy != NULL) lmtp_proxy_deinit(&client->proxy); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->to_idle != NULL) timeout_remove(&client->to_idle); if (client->ssl_iostream != NULL) diff --git a/src/log/log-connection.c b/src/log/log-connection.c index e687705e5a..aa8d8450cd 100644 --- a/src/log/log-connection.c +++ b/src/log/log-connection.c @@ -437,8 +437,7 @@ log_connection_destroy(struct log_connection *log, bool shutting_down) } i_stream_unref(&log->input); - if (log->io != NULL) - io_remove(&log->io); + io_remove(&log->io); if (close(log->fd) < 0) i_error("close(log connection fd) failed: %m"); i_free(log->default_prefix); diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index d5e9bc52e3..92709b46a7 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -69,8 +69,7 @@ static void client_auth_failed(struct client *client) if (client->auth_initializing || client->destroyed) return; - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); client->io = io_add(client->fd, IO_READ, client_input, client); client_input(client); @@ -463,8 +462,7 @@ static int proxy_start(struct client *client, client->proxy_not_trusted = reply->proxy_not_trusted; /* disable input until authentication is finished */ - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); return 0; } @@ -781,8 +779,7 @@ int client_auth_begin(struct client *client, const char *mech_name, return 1; /* don't handle input until we get the initial auth reply */ - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); client_set_auth_waiting(client); return 0; } diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index 2f5f696c2e..c9f394d0c3 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -263,8 +263,7 @@ void client_destroy(struct client *client, const char *reason) i_assert(!client->authenticating); } - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); if (client->to_disconnect != NULL) timeout_remove(&client->to_disconnect); if (client->to_auth_waiting != NULL) @@ -473,8 +472,7 @@ void client_cmd_starttls(struct client *client) /* remove input handler, SSL proxy gives us a new fd. we also have to remove it in case we have to wait for buffer to be flushed */ - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); client->v.notify_starttls(client, TRUE, "Begin TLS negotiation now."); diff --git a/src/login-common/login-proxy.c b/src/login-common/login-proxy.c index 961274347b..49f80a8204 100644 --- a/src/login-common/login-proxy.c +++ b/src/login-common/login-proxy.c @@ -479,8 +479,7 @@ static void login_proxy_disconnect(struct login_proxy *proxy) proxy->state_rec->num_proxying_connections--; } - if (proxy->server_io != NULL) - io_remove(&proxy->server_io); + io_remove(&proxy->server_io); if (proxy->server_input != NULL) i_stream_destroy(&proxy->server_input); if (proxy->server_output != NULL) @@ -502,8 +501,7 @@ static void login_proxy_free_final(struct login_proxy *proxy) timeout_remove(&proxy->to); } - if (proxy->client_io != NULL) - io_remove(&proxy->client_io); + io_remove(&proxy->client_io); if (proxy->client_input != NULL) i_stream_destroy(&proxy->client_input); if (proxy->client_output != NULL) diff --git a/src/login-common/main.c b/src/login-common/main.c index 8d546f8963..573f4934dd 100644 --- a/src/login-common/main.c +++ b/src/login-common/main.c @@ -152,8 +152,7 @@ client_connected_finish(const struct master_service_connection *conn) static void login_access_lookup_free(struct login_access_lookup *lookup) { - if (lookup->io != NULL) - io_remove(&lookup->io); + io_remove(&lookup->io); if (lookup->access != NULL) access_lookup_destroy(&lookup->access); if (lookup->conn.fd != -1) { @@ -185,8 +184,7 @@ static void login_access_lookup_next(struct login_access_lookup *lookup) { if (*lookup->next_socket == NULL) { /* last one */ - if (lookup->io != NULL) - io_remove(&lookup->io); + io_remove(&lookup->io); client_connected_finish(&lookup->conn); lookup->conn.fd = -1; login_access_lookup_free(lookup); diff --git a/src/login-common/ssl-proxy-openssl.c b/src/login-common/ssl-proxy-openssl.c index af14e80454..017cd8630f 100644 --- a/src/login-common/ssl-proxy-openssl.c +++ b/src/login-common/ssl-proxy-openssl.c @@ -203,8 +203,7 @@ static void ssl_set_io(struct ssl_proxy *proxy, enum ssl_io_action action) ssl_step, proxy); break; case SSL_REMOVE_INPUT: - if (proxy->io_ssl_read != NULL) - io_remove(&proxy->io_ssl_read); + io_remove(&proxy->io_ssl_read); break; case SSL_ADD_OUTPUT: if (proxy->io_ssl_write != NULL) @@ -213,8 +212,7 @@ static void ssl_set_io(struct ssl_proxy *proxy, enum ssl_io_action action) ssl_step, proxy); break; case SSL_REMOVE_OUTPUT: - if (proxy->io_ssl_write != NULL) - io_remove(&proxy->io_ssl_write); + io_remove(&proxy->io_ssl_write); break; } } @@ -222,8 +220,7 @@ static void ssl_set_io(struct ssl_proxy *proxy, enum ssl_io_action action) static void plain_block_input(struct ssl_proxy *proxy, bool block) { if (block) { - if (proxy->io_plain_read != NULL) - io_remove(&proxy->io_plain_read); + io_remove(&proxy->io_plain_read); } else { if (proxy->io_plain_read == NULL) { proxy->io_plain_read = io_add(proxy->fd_plain, IO_READ, @@ -293,8 +290,7 @@ static void plain_write(struct ssl_proxy *proxy) plain_write, proxy); } } else { - if (proxy->io_plain_write != NULL) - io_remove(&proxy->io_plain_write); + io_remove(&proxy->io_plain_write); } ssl_set_io(proxy, SSL_ADD_INPUT); @@ -731,14 +727,10 @@ void ssl_proxy_destroy(struct ssl_proxy *proxy) ssl_proxy_count--; DLLIST_REMOVE(&ssl_proxies, proxy); - if (proxy->io_ssl_read != NULL) - io_remove(&proxy->io_ssl_read); - if (proxy->io_ssl_write != NULL) - io_remove(&proxy->io_ssl_write); - if (proxy->io_plain_read != NULL) - io_remove(&proxy->io_plain_read); - if (proxy->io_plain_write != NULL) - io_remove(&proxy->io_plain_write); + io_remove(&proxy->io_ssl_read); + io_remove(&proxy->io_ssl_write); + io_remove(&proxy->io_plain_read); + io_remove(&proxy->io_plain_write); if (SSL_shutdown(proxy->ssl) != 1) { /* if bidirectional shutdown fails we need to clear diff --git a/src/master/service-monitor.c b/src/master/service-monitor.c index 058e8f3d14..67be42c466 100644 --- a/src/master/service-monitor.c +++ b/src/master/service-monitor.c @@ -403,8 +403,7 @@ void service_monitor_listen_stop(struct service *service) array_foreach(&service->listeners, listeners) { struct service_listener *l = *listeners; - if (l->io != NULL) - io_remove(&l->io); + io_remove(&l->io); } service->listening = FALSE; service->listen_pending = FALSE; @@ -526,8 +525,7 @@ void service_monitor_stop(struct service *service) { int i; - if (service->io_status != NULL) - io_remove(&service->io_status); + io_remove(&service->io_status); if (service->status_fd[0] != -1 && service->type != SERVICE_TYPE_ANVIL) { @@ -656,8 +654,7 @@ void services_monitor_stop(struct service_list *service_list, bool wait) if (wait) services_monitor_wait_and_kill(service_list); - if (service_list->io_master != NULL) - io_remove(&service_list->io_master); + io_remove(&service_list->io_master); i_close_fd(&service_list->master_fd); array_foreach(&service_list->services, services) diff --git a/src/master/service-process-notify.c b/src/master/service-process-notify.c index 90b8ccf05b..e12ae0a581 100644 --- a/src/master/service-process-notify.c +++ b/src/master/service-process-notify.c @@ -78,8 +78,7 @@ void service_process_notify_deinit(struct service_process_notify **_notify) *_notify = NULL; service_process_notify_reset(notify); - if (notify->io_write != NULL) - io_remove(¬ify->io_write); + io_remove(¬ify->io_write); aqueue_deinit(¬ify->process_queue); array_free(¬ify->processes); i_free(notify); diff --git a/src/plugins/fts/fts-parser-tika.c b/src/plugins/fts/fts-parser-tika.c index 1a17b0e489..cc9d4ba569 100644 --- a/src/plugins/fts/fts-parser-tika.c +++ b/src/plugins/fts/fts-parser-tika.c @@ -247,8 +247,7 @@ static int fts_parser_tika_deinit(struct fts_parser *_parser) timeout to ioloop unnecessarily */ if (parser->payload != NULL) i_stream_unref(&parser->payload); - if (parser->io != NULL) - io_remove(&parser->io); + io_remove(&parser->io); if (parser->http_req != NULL) http_client_request_abort(&parser->http_req); if (parser->ioloop != NULL) { diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index 96d7c6cfbf..548acfd256 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -613,8 +613,7 @@ static void client_default_destroy(struct client *client, const char *reason) i_free(client->seen_bitmask); i_free(client->msgnum_to_seq_map); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); timeout_remove(&client->to_idle); if (client->to_commit != NULL) timeout_remove(&client->to_commit); diff --git a/src/stats/client.c b/src/stats/client.c index 7d3a8d07ee..876c53062a 100644 --- a/src/stats/client.c +++ b/src/stats/client.c @@ -171,8 +171,7 @@ void client_destroy(struct client **_client) *_client = NULL; DLLIST_REMOVE(&clients, client); - if (client->io != NULL) - io_remove(&client->io); + io_remove(&client->io); i_stream_destroy(&client->input); o_stream_destroy(&client->output); if (close(client->fd) < 0) diff --git a/src/stats/stats-carbon.c b/src/stats/stats-carbon.c index 7cc276cd1f..dad728fbfc 100644 --- a/src/stats/stats-carbon.c +++ b/src/stats/stats-carbon.c @@ -33,8 +33,7 @@ stats_carbon_destroy(struct stats_send_ctx **_ctx) struct stats_send_ctx *ctx = *_ctx; *_ctx = NULL; - if (ctx->io != NULL) - io_remove(&ctx->io); + io_remove(&ctx->io); if (ctx->to != NULL) timeout_remove(&ctx->to); i_close_fd(&ctx->fd); diff --git a/src/util/rawlog.c b/src/util/rawlog.c index da0223e1a2..6c0c36da40 100644 --- a/src/util/rawlog.c +++ b/src/util/rawlog.c @@ -61,10 +61,8 @@ static void rawlog_proxy_destroy(struct rawlog_proxy *proxy) } o_stream_destroy(&proxy->out_output); } - if (proxy->client_io != NULL) - io_remove(&proxy->client_io); - if (proxy->server_io != NULL) - io_remove(&proxy->server_io); + io_remove(&proxy->client_io); + io_remove(&proxy->server_io); if (proxy->to_flush != NULL) timeout_remove(&proxy->to_flush);