From: Timo Sirainen Date: Thu, 4 Aug 2016 19:15:25 +0000 (+0300) Subject: lib-dcrypt: Fixed test-stream unit test not to leak memory X-Git-Tag: 2.3.0.rc1~3235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58764929b6656f1381253f7a60ed2629564c29b0;p=thirdparty%2Fdovecot%2Fcore.git lib-dcrypt: Fixed test-stream unit test not to leak memory Broken by previous change. --- diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index 1aa31aa5d3..dc1d24cb4f 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -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 */