1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-12-04 14:46:31 -05:00

mdata_destroy() is supposed to be idempotent

This commit is contained in:
Moritz Grimm 2020-02-12 00:39:13 +01:00
parent 3d83b1ba66
commit b923260d82
2 changed files with 3 additions and 1 deletions

View File

@ -277,7 +277,8 @@ mdata_destroy(struct mdata **md_p)
{
struct mdata *md = *md_p;
_mdata_clear(md);
if (md)
_mdata_clear(md);
xfree(md);
*md_p = NULL;
}

View File

@ -193,6 +193,7 @@ setup_checked(void)
void
teardown_checked(void)
{
mdata_destroy(&md);
mdata_destroy(&md);
ck_assert_ptr_eq(md, NULL);