]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Close ostream before istream
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 3 Oct 2016 10:39:35 +0000 (13:39 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Tue, 31 Oct 2017 15:35:48 +0000 (17:35 +0200)
If i_stream is autoclose, then o_stream
close will fail if done after i_stream
close.

src/lib-ssl-iostream/iostream-openssl.c

index 5f08c3549403901a47ee1263591c10fe68b2b7af..9cb216e4f791bd119d2eb2bc89955d9f2cb0e2e6 100644 (file)
@@ -296,8 +296,8 @@ openssl_iostream_create(struct ssl_iostream_context *ctx, const char *host,
 
 static void openssl_iostream_free(struct ssl_iostream *ssl_io)
 {
-       i_stream_unref(&ssl_io->plain_input);
        o_stream_unref(&ssl_io->plain_output);
+       i_stream_unref(&ssl_io->plain_input);
        BIO_free(ssl_io->bio_ext);
        SSL_free(ssl_io->ssl);
        i_free(ssl_io->plain_stream_errstr);