Skip to content

Commit

Permalink
lib-mail: Minor code cleanup to message_parser_deinit() calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Feb 28, 2016
1 parent 3ef9cfc commit dd59c7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/lib-mail/istream-attachment-extractor.c
Expand Up @@ -679,11 +679,10 @@ static void i_stream_attachment_extractor_close(struct iostream_private *stream,
struct attachment_istream *astream =
(struct attachment_istream *)stream;
struct message_part *parts;
int ret;

if (astream->parser != NULL) {
ret = message_parser_deinit(&astream->parser, &parts);
i_assert(ret == 0); /* we didn't use preparsed message_parts */
if (message_parser_deinit(&astream->parser, &parts) < 0)
i_unreached(); /* we didn't use preparsed message_parts */
}
hash_format_deinit_free(&astream->set.hash_format);
if (astream->pool != NULL)
Expand Down
6 changes: 4 additions & 2 deletions src/lib-mail/istream-binary-converter.c
Expand Up @@ -274,8 +274,10 @@ static void i_stream_binary_converter_close(struct iostream_private *stream,
(struct binary_converter_istream *)stream;
struct message_part *parts;

if (bstream->parser != NULL)
(void)message_parser_deinit(&bstream->parser, &parts);
if (bstream->parser != NULL) {
if (message_parser_deinit(&bstream->parser, &parts) < 0)
i_unreached(); /* we didn't use preparsed message_parts */
}
if (bstream->pool != NULL)
pool_unref(&bstream->pool);
if (close_parent)
Expand Down

0 comments on commit dd59c7a

Please sign in to comment.