Skip to content

Commit

Permalink
lib-dcrypt: Fixed test-stream unit test not to leak memory
Browse files Browse the repository at this point in the history
Broken by previous change.
  • Loading branch information
sirainen committed Aug 4, 2016
1 parent 15e175c commit 3ddf19c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib-dcrypt/test-stream.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit 3ddf19c

Please sign in to comment.