]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: Fix memory leak in test-istream-attachment
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 23 Dec 2016 19:15:49 +0000 (14:15 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 23 Dec 2016 19:15:49 +0000 (14:15 -0500)
src/lib-mail/test-istream-attachment.c

index e9376e0903329e19592850e5fec98e210f548d7f..3685817b6ebb86d0cd3bfd397d782943a7036e17 100644 (file)
@@ -188,12 +188,14 @@ static int test_close_attachment_ostream(struct ostream *output, bool success,
 }
 
 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;
 }