io_remove(&conn->io);
i_stream_destroy(&conn->input);
- if (conn->output != NULL)
- o_stream_destroy(&conn->output);
+ o_stream_destroy(&conn->output);
if (close(conn->fd) < 0)
i_error("close(anvil conn) failed: %m");
i_free(conn);
static void winbind_helper_disconnect(struct winbind_helper *winbind)
{
- if (winbind->in_pipe != NULL)
- i_stream_destroy(&winbind->in_pipe);
- if (winbind->out_pipe != NULL)
- o_stream_destroy(&winbind->out_pipe);
+ i_stream_destroy(&winbind->in_pipe);
+ o_stream_destroy(&winbind->out_pipe);
}
static void winbind_wait_pid(struct winbind_helper *winbind)
(struct passwd_file_userdb_iterate_context *)_ctx;
int ret = _ctx->failed ? -1 : 0;
- if (ctx->input != NULL)
- i_stream_destroy(&ctx->input);
+ i_stream_destroy(&ctx->input);
i_free(ctx->path);
i_free(ctx);
return ret;
DLLIST_REMOVE(&login_connections, conn);
io_remove(&conn->io);
- if (conn->input != NULL)
- i_stream_destroy(&conn->input);
+ i_stream_destroy(&conn->input);
o_stream_destroy(&conn->output);
if (close(conn->fd) < 0)
i_error("close(login connection) failed: %m");
if (conn->ssl_iostream != NULL)
ssl_iostream_destroy(&conn->ssl_iostream);
- if (conn->output != NULL)
- o_stream_destroy(&conn->output);
+ o_stream_destroy(&conn->output);
io_remove(&conn->io);
- if (conn->input != NULL) {
- i_stream_destroy(&conn->input);
- }
+ i_stream_destroy(&conn->input);
if (conn->fd > 0 && close(conn->fd) < 0)
i_error("close(client) failed: %m");
print_connection_released();
timeout_remove(&conn->to_input);
- if (conn->input != NULL)
- i_stream_destroy(&conn->input);
- if (conn->output != NULL)
- o_stream_destroy(&conn->output);
- if (conn->cmd_input != NULL)
- i_stream_destroy(&conn->cmd_input);
+ i_stream_destroy(&conn->input);
+ o_stream_destroy(&conn->output);
+ i_stream_destroy(&conn->cmd_input);
/* close cmd_output after its parent, so the "." isn't sent */
- if (conn->cmd_output != NULL)
- o_stream_destroy(&conn->cmd_output);
+ o_stream_destroy(&conn->cmd_output);
if (conn->ssl_iostream != NULL)
ssl_iostream_unref(&conn->ssl_iostream);
io_remove(&conn->io);
client->worker_state = IMAP_URLAUTH_WORKER_STATE_INACTIVE;
io_remove(&client->ctrl_io);
- if (client->ctrl_output != NULL)
- o_stream_destroy(&client->ctrl_output);
- if (client->ctrl_input != NULL)
- i_stream_destroy(&client->ctrl_input);
+ o_stream_destroy(&client->ctrl_output);
+ i_stream_destroy(&client->ctrl_input);
if (client->fd_ctrl >= 0) {
net_disconnect(client->fd_ctrl);
client->fd_ctrl = -1;
io_remove(&client->ctrl_io);
timeout_remove(&client->to_idle);
- if (client->input != NULL)
- i_stream_destroy(&client->input);
- if (client->output != NULL)
- o_stream_destroy(&client->output);
-
- if (client->ctrl_input != NULL)
- i_stream_destroy(&client->ctrl_input);
- if (client->ctrl_output != NULL)
- o_stream_destroy(&client->ctrl_output);
+ i_stream_destroy(&client->input);
+ o_stream_destroy(&client->output);
+
+ i_stream_destroy(&client->ctrl_input);
+ o_stream_destroy(&client->ctrl_output);
fd_close_maybe_stdio(&client->fd_in, &client->fd_out);
if (client->fd_ctrl >= 0)
timeout_remove(&client->to_idle);
io_remove(&client->io);
- if (client->input != NULL)
- i_stream_destroy(&client->input);
+ i_stream_destroy(&client->input);
if (client->fd != -1) {
if (close(client->fd) < 0)
i_error("close(%s) failed: %m", client->path);
{
struct test_fs_file *file = (struct test_fs_file *)_file;
- if (_file->output != NULL)
- o_stream_destroy(&_file->output);
+ o_stream_destroy(&_file->output);
if (file->wait_async) {
fs_set_error_async(_file->fs);
return 0;
{
struct fs_file_istream *fstream = (struct fs_file_istream *)stream;
- if (fstream->istream.parent != NULL)
- i_stream_destroy(&fstream->istream.parent);
+ i_stream_destroy(&fstream->istream.parent);
fs_file_deinit(&fstream->file);
}
{
struct attachment_istream_part *part = &astream->part;
- if (part->temp_output != NULL)
- o_stream_destroy(&part->temp_output);
+ o_stream_destroy(&part->temp_output);
i_close_fd(&part->temp_fd);
i_free_and_null(part->content_type);
timeout_remove(&auth->to);
io_remove(&auth->io);
if (auth->fd != -1) {
- if (auth->input != NULL)
- i_stream_destroy(&auth->input);
- if (auth->output != NULL)
- o_stream_destroy(&auth->output);
+ i_stream_destroy(&auth->input);
+ o_stream_destroy(&auth->output);
net_disconnect(auth->fd);
auth->fd = -1;
{
int ret;
- if (pclient->program_output != NULL)
- o_stream_destroy(&pclient->program_output);
+ o_stream_destroy(&pclient->program_output);
if ((ret = pclient->close_output(pclient)) < 0)
return -1;
pclient->program_output = NULL;
else
i_stream_destroy(&pclient->program_input);
}
- if (pclient->program_output != NULL)
- o_stream_destroy(&pclient->program_output);
+ o_stream_destroy(&pclient->program_output);
io_remove(&pclient->io);
/* if we read anything, fix the atime if needed */
mbox_file_fix_atime(mbox);
- if (mbox->mbox_stream != NULL)
- i_stream_destroy(&mbox->mbox_stream);
+ i_stream_destroy(&mbox->mbox_stream);
if (mbox->mbox_file_stream != NULL) {
if (mbox->mbox_fd == -1) {
static void mbox_transaction_save_deinit(struct mbox_save_context *ctx)
{
- if (ctx->output != NULL)
- o_stream_destroy(&ctx->output);
+ o_stream_destroy(&ctx->output);
str_free(&ctx->headers);
}
timeout_remove(&mbox->keep_lock_to);
mbox_file_close(mbox);
- if (mbox->mbox_file_stream != NULL)
- i_stream_destroy(&mbox->mbox_file_stream);
+ i_stream_destroy(&mbox->mbox_file_stream);
index_storage_mailbox_close(box);
}
dns_lookup_abort(&client->dns_lookup);
timeout_remove(&client->to);
io_remove(&client->io);
- if (client->input != NULL)
- i_stream_destroy(&client->input);
- if (client->output != NULL)
- o_stream_destroy(&client->output);
+ i_stream_destroy(&client->input);
+ o_stream_destroy(&client->output);
if (client->ssl_iostream != NULL)
ssl_iostream_unref(&client->ssl_iostream);
if (client->fd != -1) {
*_ctx = NULL;
- if (ctx->input != NULL)
- i_stream_destroy(&ctx->input);
+ i_stream_destroy(&ctx->input);
str_free(&ctx->name);
i_free(ctx->path);
i_free(ctx);
}
io_remove(&proxy->server_io);
- if (proxy->server_input != NULL)
- i_stream_destroy(&proxy->server_input);
- if (proxy->server_output != NULL)
- o_stream_destroy(&proxy->server_output);
+ i_stream_destroy(&proxy->server_input);
+ o_stream_destroy(&proxy->server_output);
if (proxy->server_fd != -1) {
net_disconnect(proxy->server_fd);
proxy->server_fd = -1;
}
io_remove(&proxy->client_io);
- if (proxy->client_input != NULL)
- i_stream_destroy(&proxy->client_input);
- if (proxy->client_output != NULL)
- o_stream_destroy(&proxy->client_output);
+ i_stream_destroy(&proxy->client_input);
+ o_stream_destroy(&proxy->client_output);
if (proxy->client_fd != -1)
net_disconnect(proxy->client_fd);
if (proxy->ssl_server_proxy != NULL) {
{
int fd;
- if (proxy->server_input != NULL)
- i_stream_destroy(&proxy->server_input);
- if (proxy->server_output != NULL)
- o_stream_destroy(&proxy->server_output);
+ i_stream_destroy(&proxy->server_input);
+ o_stream_destroy(&proxy->server_output);
io_remove(&proxy->server_io);
fd = ssl_proxy_client_alloc(proxy->server_fd, &proxy->client->ip,
o_stream_unref(&_file->output);
}
if (!success) {
- if (file->temp_output != NULL)
- o_stream_destroy(&file->temp_output);
+ o_stream_destroy(&file->temp_output);
if (file->super_output != NULL)
fs_write_stream_abort_parent(_file, &file->super_output);
return -1;
"write(%s) failed: %s",
o_stream_get_name(file->super_output),
o_stream_get_error(file->super_output));
- } else if (file->temp_output != NULL) {
+ } else {
o_stream_destroy(&file->temp_output);
}
return -1;
struct mail_filter_istream *mstream =
(struct mail_filter_istream *)stream;
- if (mstream->ext_in != NULL)
- i_stream_destroy(&mstream->ext_in);
- if (mstream->ext_out != NULL)
- o_stream_destroy(&mstream->ext_out);
+ i_stream_destroy(&mstream->ext_in);
+ o_stream_destroy(&mstream->ext_out);
if (mstream->fd != -1) {
if (close(mstream->fd) < 0)
i_error("ext-filter: close() failed: %m");
struct mail_filter_ostream *mstream =
(struct mail_filter_ostream *)stream;
- if (mstream->ext_in != NULL)
- i_stream_destroy(&mstream->ext_in);
- if (mstream->ext_out != NULL)
- o_stream_destroy(&mstream->ext_out);
+ i_stream_destroy(&mstream->ext_in);
+ o_stream_destroy(&mstream->ext_out);
if (mstream->fd != -1) {
if (close(mstream->fd) < 0)
i_error("ext-filter: close() failed: %m");
return;
i_stream_destroy(&conn->input);
- if (conn->output != NULL)
- o_stream_destroy(&conn->output);
+ o_stream_destroy(&conn->output);
i_free(conn);
}