From cb77b073ded0baadea9785e8892695978b9f0c05 Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Mon, 25 Sep 2017 21:01:55 +0200 Subject: [PATCH] Explicitly check that m_str is NULL after an error return Hopefully, this is enough of a hint to Coverity to squelch that resource leak false positive as well ... --- tests/check_stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/check_stream.c b/tests/check_stream.c index 0579424..cf3ea11 100644 --- a/tests/check_stream.c +++ b/tests/check_stream.c @@ -68,15 +68,18 @@ START_TEST(test_stream) ck_assert_int_ne(stream_set_metadata(s1, NULL, NULL), 0); m_str = NULL; - ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); + ck_assert_ptr_eq(m_str, NULL); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test15-title.ogg"), 0); ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); + ck_assert_ptr_eq(m_str, NULL); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test16-nometa.ogg"), 0); ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); + ck_assert_ptr_eq(m_str, NULL); cfg_set_metadata_format_str("test", NULL); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test01-artist+album+title.ogg"), 0); ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); + ck_assert_ptr_eq(m_str, NULL); mdata_destroy(&m); }