changeset 21691:6e5ac036ed73

lib-mail: Fix memory leak in test-istream-attachment
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Fri, 23 Dec 2016 14:15:49 -0500
parents 9eec2e30f6ea
children ce8b35e40712
files src/lib-mail/test-istream-attachment.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/test-istream-attachment.c	Fri Dec 23 13:08:59 2016 -0500
+++ b/src/lib-mail/test-istream-attachment.c	Fri Dec 23 14:15:49 2016 -0500
@@ -188,12 +188,14 @@
 }
 
 static int
-test_close_attachment_ostream_error(struct ostream *output ATTR_UNUSED,
+test_close_attachment_ostream_error(struct ostream *output,
 				    bool success, const char **error,
 				    void *context ATTR_UNUSED)
 {
 	if (success)
 		*error = "test output error";
+	o_stream_ignore_last_errors(output);
+	o_stream_destroy(&output);
 	return -1;
 }