changeset 17908:64e59ebcfe25

lib-mail: Added asserts
author Timo Sirainen <tss@iki.fi>
date Tue, 07 Oct 2014 20:28:06 +0300
parents 51233ae4af26
children 2b84c33d5d11
files src/lib-mail/message-parser.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/message-parser.c	Tue Oct 07 20:13:36 2014 +0300
+++ b/src/lib-mail/message-parser.c	Tue Oct 07 20:28:06 2014 +0300
@@ -984,6 +984,8 @@
 {
 	struct message_parser_ctx *ctx;
 
+	i_assert(parts != NULL);
+
 	ctx = message_parser_init_int(input, hdr_flags, flags);
 	ctx->parts = ctx->part = parts;
 	ctx->parse_next_block = preparsed_parse_next_header_init;
@@ -1003,6 +1005,7 @@
 		message_parse_header_deinit(&ctx->hdr_parser_ctx);
 	i_stream_unref(&ctx->input);
 	pool_unref(&ctx->parser_pool);
+	i_assert(ret < 0 || *parts_r != NULL);
 	return ret;
 }