]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: message-header-parser now keeps istream referenced.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 11 Jun 2016 18:20:37 +0000 (21:20 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 14 Jun 2016 09:25:23 +0000 (12:25 +0300)
src/lib-mail/message-header-parser.c

index 449667d750f7cbb896967e06ed464ad7aedec0bd..587048fc589893efe32d4792fe43e30eb029556a 100644 (file)
@@ -33,6 +33,7 @@ message_parse_header_init(struct istream *input, struct message_size *hdr_size,
        ctx->name = str_new(default_pool, 128);
        ctx->flags = flags;
        ctx->value_buf = buffer_create_dynamic(default_pool, 4096);
+       i_stream_ref(input);
 
        if (hdr_size != NULL)
                memset(hdr_size, 0, sizeof(*hdr_size));
@@ -43,6 +44,7 @@ void message_parse_header_deinit(struct message_header_parser_ctx **_ctx)
 {
        struct message_header_parser_ctx *ctx = *_ctx;
 
+       i_stream_unref(&ctx->input);
        buffer_free(&ctx->value_buf);
        str_free(&ctx->name);
        i_free(ctx);