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:
parent
3d83b1ba66
commit
b923260d82
@ -277,6 +277,7 @@ mdata_destroy(struct mdata **md_p)
|
|||||||
{
|
{
|
||||||
struct mdata *md = *md_p;
|
struct mdata *md = *md_p;
|
||||||
|
|
||||||
|
if (md)
|
||||||
_mdata_clear(md);
|
_mdata_clear(md);
|
||||||
xfree(md);
|
xfree(md);
|
||||||
*md_p = NULL;
|
*md_p = NULL;
|
||||||
|
@ -193,6 +193,7 @@ setup_checked(void)
|
|||||||
void
|
void
|
||||||
teardown_checked(void)
|
teardown_checked(void)
|
||||||
{
|
{
|
||||||
|
mdata_destroy(&md);
|
||||||
mdata_destroy(&md);
|
mdata_destroy(&md);
|
||||||
ck_assert_ptr_eq(md, NULL);
|
ck_assert_ptr_eq(md, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user