Commit cb77b073 authored by Moritz Grimm's avatar Moritz Grimm
Browse files

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 ...
parent a896f2cc
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment