]> 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:16:05 +0000 (22:16 +0300)
Broken by previous change.

src/lib-dcrypt/test-stream.c

index 00dfe0610d4d25a502810439b7abd4eb1a45b26b..b47b087bff011eef0786954a8f29bbc305d59b7d 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 = iostream_temp_finish(&os, IO_BLOCK_SIZE);
@@ -234,6 +235,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 = iostream_temp_finish(&os, IO_BLOCK_SIZE);
@@ -266,6 +268,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 */
 
@@ -301,6 +304,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 = iostream_temp_finish(&os, IO_BLOCK_SIZE);
@@ -339,6 +343,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 = iostream_temp_finish(&os, IO_BLOCK_SIZE);
@@ -373,6 +378,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 */