]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Fixed test-stream unit test not to leak memory
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 4 Aug 2016 19:15:25 +0000 (22:15 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 4 Aug 2016 19:15:25 +0000 (22:15 +0300)
Broken by previous change.

src/lib-dcrypt/test-stream.c

index 1aa31aa5d3a3068a6d276ebfdaca66a81f35487f..dc1d24cb4fe4ba5b8e233e42b3871292a13db33f 100644 (file)
@@ -194,6 +194,7 @@ void test_write_read_v1(void)
        test_assert(o_stream_nfinish(os_2) == 0);
        test_assert(os_2->stream_errno == 0);
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
 
        struct istream *is = test_istream_create_data(buf->data, buf->used);
@@ -241,6 +242,7 @@ void test_write_read_v1_short(void)
        test_assert(o_stream_nfinish(os_2) == 0);
        test_assert(os_2->stream_errno == 0);
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
 
        struct istream *is = test_istream_create_data(buf->data, buf->used);
@@ -280,6 +282,7 @@ void test_write_read_v1_empty(void)
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
        /* this should've been enough */
 
@@ -322,6 +325,7 @@ void test_write_read_v2(void)
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
 
        struct istream *is = test_istream_create_data(buf->data, buf->used);
@@ -367,6 +371,7 @@ void test_write_read_v2_short(void)
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
 
        struct istream *is = test_istream_create_data(buf->data, buf->used);
@@ -408,6 +413,7 @@ void test_write_read_v2_empty(void)
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
+       o_stream_unref(&os);
        o_stream_unref(&os_2);
        /* this should've been enough */