From: Timo Sirainen Date: Mon, 4 Oct 2021 22:39:50 +0000 (+0300) Subject: lib: test-istream-concat - Unref child istreams immediately X-Git-Tag: 2.3.18~213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e830aca4ef60fe7410cb7377421ac568b3e6887c;p=thirdparty%2Fdovecot%2Fcore.git lib: test-istream-concat - Unref child istreams immediately This doesn't currently make a difference, since istream-concat keeps them internally referenced. In case this changes and snapshot handling isn't fixed similarly to istream-chain, the unit test should now fail. --- diff --git a/src/lib/test-istream-concat.c b/src/lib/test-istream-concat.c index 2975364395..5e80cfa7b6 100644 --- a/src/lib/test-istream-concat.c +++ b/src/lib/test-istream-concat.c @@ -178,6 +178,11 @@ static void test_istream_concat_snapshot(void) }; input = i_stream_create_concat(test_istreams); + for (unsigned int i = 0; test_istreams[i] != NULL; i++) { + struct istream *tmp_istream = test_istreams[i]; + i_stream_unref(&tmp_istream); + } + test_istream_set_size(test_istreams[0], 20); test_istream_set_size(test_istreams[1], 0); test_istream_set_size(test_istreams[2], 0); @@ -223,8 +228,6 @@ static void test_istream_concat_snapshot(void) "!\"#$%&'()*+,-./01234567890:;<=", 51) == 0); i_stream_unref(&input); - for (unsigned int i = 0; test_istreams[i] != NULL; i++) - i_stream_unref(&test_istreams[i]); test_end(); }